org.designwizard.main.util
Class FileUtil
java.lang.Object
org.designwizard.main.util.FileUtil
public class FileUtil
- extends java.lang.Object
Constructor Summary |
FileUtil(java.io.File file)
|
Method Summary |
static boolean |
deleteDir(java.io.File directory)
Deletes the given directory. |
static java.io.File |
extractFilesFromZipFile(java.lang.String pathOfEarFile,
java.lang.String internalPath)
This method extracts the files within an ear file to the directory returned. |
java.lang.String |
readLn()
Reads a line of text. |
void |
reset()
|
static boolean |
writeResult(java.io.File file,
java.lang.String contents)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUtil
public FileUtil(java.io.File file)
throws java.io.IOException
- Throws:
java.io.IOException
writeResult
public static boolean writeResult(java.io.File file,
java.lang.String contents)
readLn
public java.lang.String readLn()
- Reads a line of text. A line is considered to be terminated by any one
of a line feed ('\n'), a carriage return ('\r'), or a carriage return
followed immediately by a linefeed.
- Returns:
- A String containing the contents of the line, not including
any line-termination characters, or null if the end of the
stream has been reached
extractFilesFromZipFile
public static java.io.File extractFilesFromZipFile(java.lang.String pathOfEarFile,
java.lang.String internalPath)
throws java.io.IOException
- This method extracts the files within an ear file to the directory returned.
- Parameters:
pathOfEarFile
- The path of the ear file to be extracted.
- Returns:
- the directory where the ear file was extracted.
- Throws:
java.io.FileNotFoundException
java.io.IOException
deleteDir
public static boolean deleteDir(java.io.File directory)
throws java.io.IOException
- Deletes the given directory.
- Parameters:
directory
- The directory to be deleted.
- Returns:
- true if the directory was deleted; false otherwise.
- Throws:
java.io.IOException
reset
public void reset()
throws java.io.IOException
- Throws:
java.io.IOException