org.apache.geronimo.main
Class Utils

java.lang.Object
  extended by org.apache.geronimo.main.Utils

public class Utils
extends Object


Field Summary
static String HOME_DIR_SYS_PROP
           
static String LOG4J_CONFIG_PROP
           
static String SERVER_DIR_SYS_PROP
           
static String SERVER_NAME_SYS_PROP
           
 
Constructor Summary
Utils()
           
 
Method Summary
static void clearSunJarFileFactoryCache(String jarLocation)
           
static File getGeronimoBase(File base)
           
static File getGeronimoHome()
           
static Properties loadPropertiesFile(File file, boolean critical)
           
static boolean recursiveDelete(File root)
           
static void setLog4jConfigurationFile(File base, String defaultFile)
           
static void setTempDirectory(File base)
           
static String substVars(String val, String currentKey, Map<String,String> cycleMap, Properties configProps)
           This method performs property variable substitution on the specified value.
static File validateDirectory(File path, String errPrefix, boolean checkWritable)
           
static File validateDirectory(String path, String errPrefix, boolean checkWritable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVER_NAME_SYS_PROP

public static final String SERVER_NAME_SYS_PROP
See Also:
Constant Field Values

SERVER_DIR_SYS_PROP

public static final String SERVER_DIR_SYS_PROP
See Also:
Constant Field Values

HOME_DIR_SYS_PROP

public static final String HOME_DIR_SYS_PROP
See Also:
Constant Field Values

LOG4J_CONFIG_PROP

public static final String LOG4J_CONFIG_PROP
See Also:
Constant Field Values
Constructor Detail

Utils

public Utils()
Method Detail

getGeronimoHome

public static File getGeronimoHome()
                            throws IOException
Throws:
IOException

getGeronimoBase

public static File getGeronimoBase(File base)

setTempDirectory

public static void setTempDirectory(File base)

setLog4jConfigurationFile

public static void setLog4jConfigurationFile(File base,
                                             String defaultFile)

validateDirectory

public static File validateDirectory(String path,
                                     String errPrefix,
                                     boolean checkWritable)

validateDirectory

public static File validateDirectory(File path,
                                     String errPrefix,
                                     boolean checkWritable)

loadPropertiesFile

public static Properties loadPropertiesFile(File file,
                                            boolean critical)
                                     throws IOException
Throws:
IOException

substVars

public static String substVars(String val,
                               String currentKey,
                               Map<String,String> cycleMap,
                               Properties configProps)
                        throws IllegalArgumentException

This method performs property variable substitution on the specified value. If the specified value contains the syntax ${<prop-name>}, where <prop-name> refers to either a configuration property or a system property, then the corresponding property value is substituted for the variable placeholder. Multiple variable placeholders may exist in the specified value as well as nested variable placeholders, which are substituted from inner most to outer most. Configuration properties override system properties.

Parameters:
val - The string on which to perform property substitution.
currentKey - The key of the property being evaluated used to detect cycles.
cycleMap - Map of variable references used to detect nested cycles.
configProps - Set of configuration properties.
Returns:
The value of the specified string after system property substitution.
Throws:
IllegalArgumentException - If there was a syntax error in the property placeholder syntax or a recursive variable reference.

recursiveDelete

public static boolean recursiveDelete(File root)

clearSunJarFileFactoryCache

public static void clearSunJarFileFactoryCache(String jarLocation)


Copyright © 2003-2011 The Apache Geronimo development community. All Rights Reserved.