|
Purple Code | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.purpletech.util.IOUtils
Miscellaneous file- and IO-related utility methods
| Constructor Summary | |
IOUtils()
|
|
| Method Summary | |
static void |
chmod(java.io.File file,
java.lang.String mode)
|
static void |
copyFile(java.io.File source,
java.io.File target)
Copies one file to another. |
static java.lang.String |
fixPath(java.lang.String path)
Removes "./" and "foo/../" and trailing "/" from pathname turns \ (backslash) into / (forward slash) |
static java.util.Stack |
getPathStack(java.lang.String path)
Given a filesystem path with slashes, turns it into a stack, where each entry on the stack is a directory in the path. |
static boolean |
isDiff(java.io.File a,
java.io.File b)
compares the contents of two files |
static boolean |
isDiff(java.io.InputStream a,
java.io.InputStream b)
compares the contents of two streams |
static java.lang.String |
loadFile(java.io.File file)
Deprecated. readFile |
static java.util.Properties |
loadProperties(java.io.File file)
|
static java.util.Properties |
loadProperties(java.lang.String filename)
|
static void |
lock(java.io.File f)
Place a ".lock" file next to the given file. |
static void |
log(java.lang.String s)
Prints a very simple log message to System.err |
static java.lang.String |
readFile(java.io.File file)
|
static java.lang.String |
readReader(java.io.Reader input)
|
static java.lang.String |
readStream(java.io.InputStream input)
|
static void |
unlock(java.io.File f)
Removes the ".lock" file |
static void |
writeFile(java.io.File dir,
java.lang.String name,
java.io.InputStream data)
Write the input stream to the file as raw data |
static void |
writeProperties(java.io.File dir,
java.lang.String name,
java.util.Properties prop)
Write the properties parameter to the file as raw data |
static void |
writeString(java.io.File file,
java.lang.String data)
Write the input string to the file as raw data |
static void |
writeString(java.io.File dir,
java.lang.String name,
java.lang.String data)
Write the input string to the file as raw data |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public IOUtils()
| Method Detail |
public static java.lang.String readFile(java.io.File file)
throws java.io.IOException
file - file to read
java.io.IOException
public static java.lang.String readStream(java.io.InputStream input)
throws java.io.IOException
input - stream to read
java.io.IOException
public static java.lang.String readReader(java.io.Reader input)
throws java.io.IOException
input - stream to read
java.io.IOException
public static void lock(java.io.File f)
throws java.io.IOException
java.io.IOExceptionunlock(File)
public static void unlock(java.io.File f)
throws java.io.IOException
java.io.IOExceptionlock(File)public static void log(java.lang.String s)
public static java.lang.String loadFile(java.io.File file)
throws java.io.IOException
java.io.IOException
public static java.util.Properties loadProperties(java.lang.String filename)
throws java.io.IOException
java.io.IOException
public static java.util.Properties loadProperties(java.io.File file)
throws java.io.IOException
java.io.IOException
public static void writeFile(java.io.File dir,
java.lang.String name,
java.io.InputStream data)
throws java.io.IOException
dir - directory to put the file inname - name of new filedata - the data to write in the file
java.io.IOException
public static void writeString(java.io.File dir,
java.lang.String name,
java.lang.String data)
throws java.io.IOException
dir - directory to put the file inname - name of new filedata - the data to write in the file
java.io.IOException
public static void writeString(java.io.File file,
java.lang.String data)
throws java.io.IOException
data - the data to write in the file
java.io.IOException
public static void writeProperties(java.io.File dir,
java.lang.String name,
java.util.Properties prop)
throws java.io.IOException
dir - directory to put the file inname - name of new file
java.io.IOException
public static java.lang.String fixPath(java.lang.String path)
throws java.io.IOException
java.io.IOException
public static java.util.Stack getPathStack(java.lang.String path)
throws java.io.IOException
java.io.IOException
public static boolean isDiff(java.io.File a,
java.io.File b)
throws java.io.IOException
java.io.IOException
public static boolean isDiff(java.io.InputStream a,
java.io.InputStream b)
throws java.io.IOException
java.io.IOException
public static void copyFile(java.io.File source,
java.io.File target)
throws java.io.IOException
java.io.IOException
public static void chmod(java.io.File file,
java.lang.String mode)
throws java.io.IOException
java.io.IOException
|
Documentation generated March 5 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||