View Javadoc
1   package org.andromda.core.common;
2   
3   import org.apache.commons.lang.StringUtils;
4   
5   /**
6    * Stores any constants used throughout the
7    * AndroMDA codebase.
8    *
9    * @author Chad Brandon
10   */
11  public class Constants
12  {
13      /**
14       * The location of the AndroMDA temporary directory. This is where any
15       * temporary resources are placed during AndroMDA execution.
16       */
17      public static final String TEMPORARY_DIRECTORY;
18  
19      /**
20       * Perform any constant initialization.
21       */
22      static
23      {
24          // - initialize the TEMPORARY_DIRECTORY
25          final String tmpDir = System.getProperty("java.io.tmpdir");
26          final StringBuilder directory = new StringBuilder(tmpDir);
27          if (!directory.toString().endsWith("/"))
28          {
29              directory.append('/');
30          }
31          final String userName = System.getProperty("user.name");
32          if (StringUtils.isNotBlank(userName))
33          {
34              directory.append(userName).append('/');
35          }
36          directory.append(".andromda/");
37          TEMPORARY_DIRECTORY = directory.toString();
38      }
39  
40      /**
41       * The name of the metafacades component.
42       */
43      public static final String COMPONENT_METAFACADES = "metafacades";
44  }