|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jlog2.util.FileLoader
public class FileLoader
This class can be used to load in a file from a local or remote location.
Constructor Summary | |
---|---|
FileLoader()
Create a new instance of FileLoader |
Method Summary | |
---|---|
static void |
copyStream(java.io.File sourceFile,
java.io.File destFile)
Copy the source input stream contents to the destination file. |
static void |
deleteFile(java.lang.String fileName)
Delete the file at the specified file path. |
static java.io.BufferedReader |
getBufferedInputStream(java.lang.String fileName)
Get the contents of the file as a buffered reader. |
static java.lang.String |
getCurrentDirectory()
Get the current directory the program is running in. |
static java.util.Vector |
getDirectoryList(java.lang.String dirPath)
Get the list of directories stored in the specified directory. |
static java.util.Vector |
getFileList(java.lang.String dirPath)
Get the list of files stored in the specified directory. |
static java.util.Vector |
getFileList(java.lang.String dirPath,
boolean subFolders)
Get the list of files stored in the specified directory. |
static java.util.Vector |
getFullFileListPaths(java.lang.String dirPath)
Get the list of files stored in the specified directory. |
static java.util.Vector |
getFullFileListPaths(java.lang.String dirPath,
boolean subFolders)
Get the list of files stored in the specified directory. |
static java.lang.String |
getInputStream(java.lang.String fileName)
Get the contents of the file as a String. |
static java.io.BufferedReader |
loadFile(java.io.File filePath)
Load a file and store in a buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileLoader()
Method Detail |
---|
public static java.lang.String getInputStream(java.lang.String fileName) throws java.lang.Exception
fileName
- the name and location of the file to load.
java.lang.Exception
- any error.public static java.io.BufferedReader getBufferedInputStream(java.lang.String fileName) throws java.lang.Exception
fileName
- the name and location of the file to load. This could be
at a remote location.
java.lang.Exception
- any error.public static java.io.BufferedReader loadFile(java.io.File filePath) throws java.lang.Exception
filePath
- the path of the file to read.
java.lang.Exception
- any error.public static java.lang.String getCurrentDirectory() throws java.lang.Exception
java.lang.Exception
- any errorpublic static java.util.Vector getDirectoryList(java.lang.String dirPath) throws java.lang.Exception
dirPath
- the directory path.
java.lang.Exception
- any error.public static java.util.Vector getFileList(java.lang.String dirPath) throws java.lang.Exception
dirPath
- the directory path.
java.lang.Exception
- any error.public static java.util.Vector getFileList(java.lang.String dirPath, boolean subFolders) throws java.lang.Exception
dirPath
- the directory path.subFolders
- if true include all files in all sub-folders, if false include
files in the current folder only.
java.lang.Exception
- any error.public static java.util.Vector getFullFileListPaths(java.lang.String dirPath) throws java.lang.Exception
dirPath
- the directory path.
java.lang.Exception
- any error.public static java.util.Vector getFullFileListPaths(java.lang.String dirPath, boolean subFolders) throws java.lang.Exception
dirPath
- the directory path.subFolders
- if true include all files in all sub-folders, if false include
files in the current folder only.
java.lang.Exception
- any error.public static void copyStream(java.io.File sourceFile, java.io.File destFile) throws java.lang.Exception
sourceFile
- the file to copy.destFile
- the file path to copy to
java.lang.Exception
- any error.public static void deleteFile(java.lang.String fileName) throws java.lang.Exception
fileName
- the name of the file to delete.
java.lang.Exception
- any error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |