|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rioproject.exec.Util
public class Util
Helpful utilities
| Field Summary | |
|---|---|
static String |
COMPONENT
|
static String |
RESOURCE_ROOT
|
| Constructor Summary | |
|---|---|
Util()
|
|
| Method Summary | |
|---|---|
static void |
chmod(File file,
String perms)
Run chmod |
static void |
chmodX(File file)
Apply execute permissions for a file |
static void |
close(Closeable c)
|
static ExecDescriptor |
extendCommandLine(String root,
ExecDescriptor exec)
Extend command line, inserting the root directory in front of the command line of the extension |
static URL |
getResource(String resource)
Get a resource using the current context classloader |
static String |
replace(String str,
String pattern,
String replace)
Search and Replace |
static int |
runShellScript(File shellScript)
Run (exec) a shell script |
static int |
runShellScript(File shellScript,
boolean sync)
Run (exec) a shell script |
static void |
writeFile(String contents,
File file)
Write contents to a file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String COMPONENT
public static final String RESOURCE_ROOT
| Constructor Detail |
|---|
public Util()
| Method Detail |
|---|
public static URL getResource(String resource)
throws IOException
resource - The resource name
IOException - If the resource cannot be loaded
public static void chmod(File file,
String perms)
throws IOException
file - The file to chmodperms - The permissions to chmod
IOException - If the command does not execute
public static void chmodX(File file)
throws IOException
file - The file to apply execute permissions on
IOException - If the command does not executepublic static void close(Closeable c)
public static void writeFile(String contents,
File file)
throws IOException
contents - The contents to writefile - The file to write to
IOException - If the file cannot be wrriten to
public static int runShellScript(File shellScript)
throws IOException
shellScript - The shell script file to exec
IOException - If the process cannot be created
public static int runShellScript(File shellScript,
boolean sync)
throws IOException
shellScript - The shell script file to execsync - If true wait for the process to complete
IOException - If the process cannot be created
public static ExecDescriptor extendCommandLine(String root,
ExecDescriptor exec)
root - The root directory nameexec - The ExecDescriptor
public static String replace(String str,
String pattern,
String replace)
str - The string to replace tokens forpattern - The pattern to look forreplace - The replacement for the pattern
|
Copyright © Rio Project. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||