|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lateralnz.common.util.SystemUtils
public class SystemUtils
various 'System' related functions
| Method Summary | |
|---|---|
static void |
copyFile(java.lang.String f1,
java.lang.String f2)
|
static java.lang.String[] |
exec(java.lang.String[] cmd,
java.lang.String[] env,
java.io.File f,
long waitPeriod)
execute a given command. |
static java.lang.String |
getArgument(java.lang.String[] args,
int idx,
java.lang.String defaultValue)
taking an array of arguments (usually in the main() method) return the value at a particular index -- or if it is null/empty, return a default value |
static void |
getFileList(java.util.List filelist,
java.lang.String directory,
java.lang.String includesRegex,
java.lang.String excludesRegex,
boolean recursive)
loads the specified list with File objects (recursing through directories if required) |
static java.lang.String[] |
getFileList(java.lang.String directory,
java.lang.String regex)
get a list of files matching a regex |
static byte[] |
getLocalhostIP()
hopefully this will return the 'real' IP address even if the hosts file is configured incorrectly (as I discovered on my test machine... |
static java.lang.reflect.Method |
getSetterMethod(java.lang.Class c,
java.lang.String property,
java.lang.Class[] paramTypes)
get the "set" method for a property given a class and paramTypes array |
static java.lang.Object |
invoke(java.lang.Object obj,
java.lang.String method,
java.lang.Object[] args)
invoke a method on an object |
static void |
invokeMain(java.lang.Class c,
java.lang.String[] args)
invoke the main method of a class |
static void |
sleep(long time)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final void copyFile(java.lang.String f1,
java.lang.String f2)
throws java.io.IOException
java.io.IOException
public static final java.lang.String[] exec(java.lang.String[] cmd,
java.lang.String[] env,
java.io.File f,
long waitPeriod)
throws java.io.IOException,
java.lang.InterruptedException
cmd - the command arrayenv - the environment arrayf - the file to use during the exec (@see java.lang.Runtime#getRuntime)waitPeriod - the length of time to wait until we assume something has gone wrong and kill the process
java.io.IOException
java.lang.InterruptedException
public static final java.lang.String getArgument(java.lang.String[] args,
int idx,
java.lang.String defaultValue)
public static final java.lang.String[] getFileList(java.lang.String directory,
java.lang.String regex)
public static final void getFileList(java.util.List filelist,
java.lang.String directory,
java.lang.String includesRegex,
java.lang.String excludesRegex,
boolean recursive)
public static final byte[] getLocalhostIP()
public static final java.lang.reflect.Method getSetterMethod(java.lang.Class c,
java.lang.String property,
java.lang.Class[] paramTypes)
throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
public static final java.lang.Object invoke(java.lang.Object obj,
java.lang.String method,
java.lang.Object[] args)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
public static final void invokeMain(java.lang.Class c,
java.lang.String[] args)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodExceptionpublic static final void sleep(long time)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||