|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ibisph.util.FileLib
public abstract class FileLib
Abstract library class that provides miscellaneous file helper methods.
| Constructor Summary | |
|---|---|
FileLib()
|
|
| Method Summary | |
|---|---|
static boolean |
createDir(java.io.File file)
Creates a directory based on the file object. |
static boolean |
createDir(java.lang.String path)
Creates a directory based on the path. |
static boolean |
createDirAndSave(java.lang.String pathAndFilename,
byte[] content)
Save the contents of the byte array to the specified filename and create any directories needed if they don't already exist. |
static boolean |
delete(java.lang.String filename)
Deletes the specified file. |
static java.lang.String |
getContent(java.io.File file)
Gets the contents of the specified file as a string. |
static java.lang.String |
getContent(java.lang.String filename)
Gets the contents of the specified file as a string. |
static int |
save(java.io.File file,
byte[] content)
Save the contents of the byte array to the specified file. |
static int |
save(java.lang.String filename,
byte[] content)
Save the contents of the byte array to the specified filename. |
static int |
save(java.lang.String filename,
java.io.InputStream inputStream)
Save the contents of the input stream to the specified filename. |
static int |
save(java.lang.String filename,
java.lang.String content)
Save the contents of the string to the specified filename. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileLib()
| Method Detail |
|---|
public static boolean delete(java.lang.String filename)
filename - relative or explicit Filename and path of the file to
be deleted.
file.delete() value.
public static java.lang.String getContent(java.lang.String filename)
throws java.io.IOException
filename - relative or explicit Filename and path of the file to
be opened and read.
java.io.IOException
public static java.lang.String getContent(java.io.File file)
throws java.io.IOException
file - File to be opened and read.
java.io.IOException
public static int save(java.io.File file,
byte[] content)
throws java.io.IOException
file - File to use to write the contents to.content - Content to be written into the file.
java.io.IOException - Associated with the file and stream operations.
public static int save(java.lang.String filename,
byte[] content)
throws java.io.IOException
filename - relative or explicit filename and path of the file to
be opened and written to.content - Content to be written into the file.
java.io.IOException - Associated with the file and stream operations.
public static int save(java.lang.String filename,
java.lang.String content)
throws java.io.IOException
filename - relative or explicit filename and path of the file to
be opened and written to.content - Content to be written into the file.
java.io.IOException - Associated with the file and stream operations.
public static int save(java.lang.String filename,
java.io.InputStream inputStream)
throws java.io.IOException
filename - relative or explicit filename and path of the file to
be opened and written to.inputStream - Streamed content to be written into the file.
java.io.IOException - Associated with the file and stream operations.
public static boolean createDirAndSave(java.lang.String pathAndFilename,
byte[] content)
throws java.io.IOException
pathAndFilename - relative or explicit filename and path of the file to
be opened and written to.content - Content to be written into the file.
java.io.IOException - Associated with the file and stream operations.public static boolean createDir(java.io.File file)
file - Contains the directory to be created.
file.mkdirs. True if and only if the directory was
created, along with all necessary parent directories; false
otherwise.public static boolean createDir(java.lang.String path)
path - Contains the directory path to be created.
file.mkdirs. True if and only if the directory was
created, along with all necessary parent directories; false
otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||