001package org.andromda.core.common;
002
003import org.apache.commons.lang.StringUtils;
004
005/**
006 * Stores any constants used throughout the
007 * AndroMDA codebase.
008 *
009 * @author Chad Brandon
010 */
011public class Constants
012{
013    /**
014     * The location of the AndroMDA temporary directory. This is where any
015     * temporary resources are placed during AndroMDA execution.
016     */
017    public static final String TEMPORARY_DIRECTORY;
018
019    /**
020     * Perform any constant initialization.
021     */
022    static
023    {
024        // - initialize the TEMPORARY_DIRECTORY
025        final String tmpDir = System.getProperty("java.io.tmpdir");
026        final StringBuilder directory = new StringBuilder(tmpDir);
027        if (!directory.toString().endsWith("/"))
028        {
029            directory.append('/');
030        }
031        final String userName = System.getProperty("user.name");
032        if (StringUtils.isNotBlank(userName))
033        {
034            directory.append(userName).append('/');
035        }
036        directory.append(".andromda/");
037        TEMPORARY_DIRECTORY = directory.toString();
038    }
039
040    /**
041     * The name of the metafacades component.
042     */
043    public static final String COMPONENT_METAFACADES = "metafacades";
044}