public class Env
A class that defined various environment variables
Version:
$Id: Env.java,v 1.11 2005/06/08 07:30:29 gonzo Exp $
Author:
james todd [gonzo at jxta dot org]
| Field Summary |
public final static String |
|
public final static String |
|
public final static String |
|
public final static String |
|
public final static String |
|
public final static int |
|
public final static String |
|
public final static String |
|
public final static String |
|
private final static String |
|
public final static String |
|
public final static String |
The directory in which preference and configuration info is saved |
private static boolean |
|
private final static Logger |
|
public final static String |
|
private static String |
|
private static boolean |
|
public final static int |
|
public final static int |
|
public final static String |
The directory relative to which all path information is handled |
private static URI |
Home directory for configuration and log files. |
public final static String |
The environment string that indicated the selected password |
public final static String |
|
public final static int |
The number of minutes before we res-send a ping signal on the ManyToMany Chat |
public final static String |
The ping message to send |
public final static String |
The file the contains configuration information written by
the platform code |
public final static String |
|
public final static String |
|
public final static String |
|
public final static String |
The environment string that indicates the user name |
public final static String |
|
public final static String |
|
public final static String |
The directory structure under which runtime config and property
files reside |
public final static String |
|
public final static String |
|
public final static String |
|
public final static int |
The interval between tree updates in minutes |
private final static String |
|
| Method Summary |
private static void |
|
public static URL |
Returns the URL of the current configuration file. |
public static URI |
Returns the URI path of the Home Directory. |
public static String |
Returns the Canonical path of the Home Directory if possible; otherwise,
returns the Absolute path. |
public static String |
|
public static URL |
Return the path to platform specific configuration
file |
private static String |
Initializes base directory URI, myjxta, and returns a String
representing the URI. |
public static void |
Initialzes the Env object with a default
preference directory of
HOME and a preference path |
public static synchronized void |
Initializes the Env class attributes, ensures that required files exists and initializes Log4J logging. |
private static void |
Ensures that the Log4J config file exists. |
private static void |
Ensures that the application config file exists in the base directory. |
public static boolean |
Returns true if the log4j config file pointed to by log4jConfigFilePath has a ".xml" extension, and false
otherwise. |
public static void |
Creates or deletes a Reconfigure file (home/reconf) depending on
whether the reconfigure param is true or false, respectively. |
public final static String ADMINISTRATION_PORT = "myjxta.sid"
public final static String CMS = "data"
public final static String CONFIGURATION = "profile.xml"
public final static String CONFIG_URL = "net.jxta.myjxta.config.url"
public final static String CONSTANTS = "/net/jxta/myjxta/resources/myjxta.xml"
DEFAULT_ADMINISTRATION_PORT
public final static int DEFAULT_ADMINISTRATION_PORT = 10701
public final static String DEFAULT_CONFIG = "file:conf/PublicAdminRules.xml"
public final static String DEFAULT_CONFIGURATION = "/net/jxta/myjxta/resources/" + CONFIGURATION
public final static String DEFAULT_LOG4J = "/net/jxta/myjxta/resources/" + LOG4J
private final static String FILE_SCHEME = "file"
public final static String FREETTS = "net.jxta.myjxta.freetts"
public final static String HOME = ".myjxta"
The directory in which preference and configuration info is saved
private static boolean isInitialized = false
private final static Logger LOG = Logger.getLogger(Env.class)
public final static String LOG4J = "log4j.xml"
private static String log4jConfigFilePath = null
private static boolean log4jConfigFileXml = false
MAX_ADMINISTRATION_PORT_TRY
public final static int MAX_ADMINISTRATION_PORT_TRY = 1000
public final static int MAX_ADMINISTRATION_TIME = 7 * 1000
public final static String MYJXTA = "JXTA_HOME"
The directory relative to which all path information is handled
private static URI myjxta = null
Home directory for configuration and log files.
public final static String PASSWORD = "net.jxta.tls.password"
The environment string that indicated the selected password
public final static String PING_COMMAND = "ping"
public final static int PING_INTERVAL = 5
The number of minutes before we res-send a ping signal on the ManyToMany Chat
public final static String PING_MESSAGE = "**** ping ****"
The ping message to send
public final static String PLATFORM = "PlatformConfig"
The file the contains configuration information written by
the platform code
public final static String PLATFORM_CONFIG = "config.properties"
public final static String PLATFORM_CONFIG_COMMENT = "generated from myjxta.xml"
public final static String PREFERENCES = "java.util.prefs.userRoot"
public final static String PRINCIPAL = "net.jxta.tls.principal"
The environment string that indicates the user name
public final static String PSE = "pse"
public final static String RECONFIGURE = "reconf"
public final static String RESOURCES = "/resources/"
The directory structure under which runtime config and property
files reside
public final static String SHARE = "share"
public final static String TCP_PORT = System.getProperty("jxta.tcp.port")
public final static String TMP = "tmp"
public final static int TREE_UPDATE_PERIOD = 3
The interval between tree updates in minutes
private final static String URI_DELIMITER = ":/"
private static void createFile(File newFile, String sourceFilePath)
Throws:
IOException
public static URL getConfiguration()
Returns the URL of the current configuration file.
public static URI getHome()
Returns the URI path of the Home Directory.
public static String getHomeDirPath()
Returns the Canonical path of the Home Directory if possible; otherwise,
returns the Absolute path.
public static String getLog4jConfigFilePath()
Return:
Returns the log4jConfigFilePath.
public static URL getPlatform()
Return the path to platform specific configuration
file
Return:
the path to the platform specific configuration file
private static String initHomeBase(String base)
Initializes base directory URI, myjxta, and returns a String
representing the URI.
Parameters:
base the base directory for the configuration information, relative to the user's home directory.
public static void initialize()
Initialzes the Env object with a default
preference directory of
HOME and a preference path
public static synchronized void initialize(String base)
Initializes the Env class attributes, ensures that required files exists and initializes Log4J logging.
Parameters:
base the base directory for the configuration information, relative to the user's home directory.
private static void initLog4JConfig(String dirPath)
Ensures that the Log4J config file exists.
Looks first for a log4j.properties configuration file, then for a log4j.xml file.
Parameters:
dirPath The base directory for the config file, relative to the user's home directory.
private static void initMyJxtaConfig(String homeBase)
Ensures that the application config file exists in the base directory.
Parameters:
homeBase The base directory for the configuration information, relative to the user's home directory.
public static boolean isLog4jConfigFileXml()
Returns true if the log4j config file pointed to by log4jConfigFilePath has a ".xml" extension, and false
otherwise.
public static void setReconfigure(boolean reconfigure)
Creates or deletes a Reconfigure file (home/reconf) depending on
whether the reconfigure param is true or false, respectively.
Parameters:
reconfigure If true, a new Reconfigure file is created;
otherwise, the existing Reconfigure file is deleted.