|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.prorefactor.core.Util
public class Util
General purpose utilities
Field Summary | |
---|---|
static java.lang.String |
LINESEP
OS specific text file line seperator - '\n' on unix, "\r\n" on Windows |
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static void |
copyAllFiles(java.io.File sourceDir,
java.io.File targetDir)
Copy all files from one directory to another. |
static void |
fileAppend(java.lang.String target,
java.lang.String source)
Append one file to another. |
static void |
fileAppendString(java.lang.String target,
java.lang.String source)
Append a string to a file. |
static void |
fileCopy(java.lang.String from,
java.lang.String to)
Copy a file. |
static java.lang.String |
getExceptionText(java.lang.Throwable e)
|
static boolean |
isInRange(int x,
int y,
int[] begin,
int[] end)
Assuming an x,y range, this function returns whether an input x and y are within the specified range of x,y begin and x,y end. |
static java.util.List |
permsList(java.util.List topList)
Given a mainlist of sublists, return a new newlist of newsublists, such that: - the number of newsublists is the number of "cycles" ("permutations"?) - each newsublist has the same number of objects in it as the original mainlist had sublists. |
static java.lang.StringBuffer |
readFile(java.io.File from)
Read the contents of a file into a StringBuffer |
static java.util.ArrayList |
split(java.lang.String s,
char divider)
Deprecated. Use Java 1.4 String.split() instead. |
static boolean |
wipeDirectory(java.io.File dir,
boolean recursive)
Delete all files and directories within a directory - causes the specified directory to be empty. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LINESEP
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static void copyAllFiles(java.io.File sourceDir, java.io.File targetDir) throws java.io.IOException
java.io.IOException
public static void fileAppend(java.lang.String target, java.lang.String source) throws java.io.IOException
target
- The file that gets appended to.source
- The file to append.
java.io.IOException
public static void fileAppendString(java.lang.String target, java.lang.String source) throws java.io.IOException
target
- The file that gets appended to.source
- The string to append.
java.io.IOException
public static void fileCopy(java.lang.String from, java.lang.String to) throws java.io.IOException
from
- filename to copy fromto
- filename to copy to
java.io.IOException
public static java.lang.String getExceptionText(java.lang.Throwable e)
public static boolean isInRange(int x, int y, int[] begin, int[] end)
x
- The x value to check that it is within rangey
- The y value to check that it is within rangebegin
- An array of 2 integers to specify the beginning of the x,y
range. May be null to indicate that the beginning is open ended.end
- An array of 2 integers to specify the ending of the x,y
range. May be null to indicate that the beginning is open ended.
public static java.util.List permsList(java.util.List topList)
public static java.lang.StringBuffer readFile(java.io.File from) throws java.io.IOException
java.io.IOException
public static java.util.ArrayList split(java.lang.String s, char divider)
s
- the string to splitdivider
- the character on which to split. Occurrences of
this character are not included in the output
public static boolean wipeDirectory(java.io.File dir, boolean recursive) throws java.io.IOException
dir
- A File object for the directory to be emptied.recursive
- Recursively delete subdirectories?
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |