01: package org.andromda.core.common;
02:
03: import org.apache.commons.lang.StringUtils;
04:
05: /**
06: * Stores any constants used throughout the
07: * AndroMDA codebase.
08: *
09: * @author Chad Brandon
10: */
11: public class Constants {
12: /**
13: * The location of the AndroMDA temporary directory. This is where any
14: * temporary resources are placed during AndroMDA execution.
15: */
16: public static final String TEMPORARY_DIRECTORY;
17:
18: /**
19: * Perform any constant initialization.
20: */
21: static {
22: // - initialize the TEMPORARY_DIRECTORY
23: final String tmpDir = System.getProperty("java.io.tmpdir");
24: final StringBuffer directory = new StringBuffer(tmpDir);
25: if (!directory.toString().endsWith("/")) {
26: directory.append("/");
27: }
28: final String userName = System.getProperty("user.name");
29: if (StringUtils.isNotBlank(userName)) {
30: directory.append(userName).append("/");
31: }
32: directory.append(".andromda/");
33: TEMPORARY_DIRECTORY = directory.toString();
34: }
35:
36: /**
37: * The name of the metafacades component.
38: */
39: public static final String COMPONENT_METAFACADES = "metafacades";
40: }
|