|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.lang.SystemUtils org.mule.util.SystemUtils
public class SystemUtils
Field Summary | |
---|---|
static boolean |
IS_JAVA_1_7
|
protected static Log |
logger
|
Fields inherited from class org.apache.commons.lang.SystemUtils |
---|
AWT_TOOLKIT, FILE_ENCODING, FILE_SEPARATOR, IS_JAVA_1_1, IS_JAVA_1_2, IS_JAVA_1_3, IS_JAVA_1_4, IS_JAVA_1_5, IS_JAVA_1_6, IS_OS_AIX, IS_OS_HP_UX, IS_OS_IRIX, IS_OS_LINUX, IS_OS_MAC, IS_OS_MAC_OSX, IS_OS_OS2, IS_OS_SOLARIS, IS_OS_SUN_OS, IS_OS_UNIX, IS_OS_WINDOWS, IS_OS_WINDOWS_2000, IS_OS_WINDOWS_95, IS_OS_WINDOWS_98, IS_OS_WINDOWS_ME, IS_OS_WINDOWS_NT, IS_OS_WINDOWS_VISTA, IS_OS_WINDOWS_XP, JAVA_AWT_FONTS, JAVA_AWT_GRAPHICSENV, JAVA_AWT_HEADLESS, JAVA_AWT_PRINTERJOB, JAVA_CLASS_PATH, JAVA_CLASS_VERSION, JAVA_COMPILER, JAVA_ENDORSED_DIRS, JAVA_EXT_DIRS, JAVA_HOME, JAVA_IO_TMPDIR, JAVA_LIBRARY_PATH, JAVA_RUNTIME_NAME, JAVA_RUNTIME_VERSION, JAVA_SPECIFICATION_NAME, JAVA_SPECIFICATION_VENDOR, JAVA_SPECIFICATION_VERSION, JAVA_UTIL_PREFS_PREFERENCES_FACTORY, JAVA_VENDOR, JAVA_VENDOR_URL, JAVA_VERSION, JAVA_VERSION_FLOAT, JAVA_VERSION_INT, JAVA_VERSION_TRIMMED, JAVA_VM_INFO, JAVA_VM_NAME, JAVA_VM_SPECIFICATION_NAME, JAVA_VM_SPECIFICATION_VENDOR, JAVA_VM_SPECIFICATION_VERSION, JAVA_VM_VENDOR, JAVA_VM_VERSION, LINE_SEPARATOR, OS_ARCH, OS_NAME, OS_VERSION, PATH_SEPARATOR, USER_COUNTRY, USER_DIR, USER_HOME, USER_LANGUAGE, USER_NAME, USER_TIMEZONE |
Constructor Summary | |
---|---|
SystemUtils()
|
Method Summary | |
---|---|
static String |
getCommandLineOption(String option,
String[] args,
String[][] opts)
Returns the value corresponding to the given option from the command line, for example if the options are "-config mule-config.xml" getCommandLineOption("config") would return "mule-config.xml" |
static Map<String,Object> |
getCommandLineOptions(String[] args,
String[][] opts)
Returns a Map of all options in the command line. |
static Map |
getenv()
Get the operating system environment variables. |
static String |
getenv(String name)
|
static boolean |
hasCommandLineOption(String option,
String[] args,
String[][] opts)
Checks whether a command line option is set. |
static boolean |
isAppleJDK()
|
static boolean |
isIbmJDK()
|
static boolean |
isSunJDK()
|
static String |
legalizeFileName(String name)
Ensure a generated file name is legal. |
static Map<String,String> |
parsePropertyDefinitions(String input)
Returns a Map of all valid property definitions in -Dkey=value
format. |
Methods inherited from class org.apache.commons.lang.SystemUtils |
---|
getJavaHome, getJavaIoTmpDir, getJavaVersion, getUserDir, getUserHome, isJavaAwtHeadless, isJavaVersionAtLeast, isJavaVersionAtLeast |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Log logger
public static final boolean IS_JAVA_1_7
Constructor Detail |
---|
public SystemUtils()
Method Detail |
---|
public static Map getenv()
public static String getenv(String name)
public static boolean isSunJDK()
public static boolean isAppleJDK()
public static boolean isIbmJDK()
public static String getCommandLineOption(String option, String[] args, String[][] opts) throws DefaultMuleException
DefaultMuleException
public static boolean hasCommandLineOption(String option, String[] args, String[][] opts) throws DefaultMuleException
DefaultMuleException
public static Map<String,Object> getCommandLineOptions(String[] args, String[][] opts) throws DefaultMuleException
DefaultMuleException
public static Map<String,String> parsePropertyDefinitions(String input)
-Dkey=value
format. -Dkey
is interpreted as -Dkey=true
,
everything else is ignored. Whitespace in values is properly handled but needs
to be quoted properly: -Dkey="some value"
.
input
- String with property definitionn
Map
of property String keys with their defined values
(Strings). If no valid key-value pairs can be parsed, the map is
empty.public static String legalizeFileName(String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |