|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uk.org.ogsadai.common.FileUtilities
Provides utilities for reading, writing and deleting files. Keeps files locked whilst in use, but allows many threads to read from the same file concurrently.
| Method Summary | |
void |
closeStreamFromFile(java.lang.String fileName,
java.io.InputStream fileDataStream)
Method closeStreamFromFile. |
void |
closeStreamToFile(java.lang.String fileName,
java.io.OutputStream fileDataStream)
Method closeStreamToFile. |
void |
deleteFile(java.lang.String fileName)
Method deleteFile. |
static FileUtilities |
getInstance()
Method getInstance. |
java.io.InputStream |
openStreamFromFile(java.lang.String fileName)
Method openStreamFromFile. |
java.io.OutputStream |
openStreamToFile(java.lang.String fileName)
Method openStreamToFile. |
byte[] |
readByteArrayFromFile(java.lang.String fileName)
Method readByteArrayFromFile. |
java.lang.String |
readStringFromFile(java.lang.String fileName)
Method readStringFromFile. |
void |
renameFile(java.lang.String fileName,
java.lang.String newFileName)
Method renameFile. |
void |
replaceWriteStringToFile(java.lang.String fileName,
java.lang.String data)
Method writeStringToFile. |
void |
writeByteArrayToFile(java.lang.String fileName,
byte[] data)
Method writeByteArrayToFile. |
void |
writeStringToFile(java.lang.String fileName,
java.lang.String data)
Method writeStringToFile. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static FileUtilities getInstance()
public java.lang.String readStringFromFile(java.lang.String fileName)
throws CommonUserException,
CommonSystemException
fileName -
CommonUserException - if the File does not exist
CommonSystemException
public byte[] readByteArrayFromFile(java.lang.String fileName)
throws CommonUserException,
CommonSystemException
fileName -
CommonUserException - if the File does not exist
CommonSystemException
public java.io.InputStream openStreamFromFile(java.lang.String fileName)
throws CommonUserException,
CommonSystemException
fileName -
CommonUserException - if the File does not exist
CommonSystemException
public void closeStreamFromFile(java.lang.String fileName,
java.io.InputStream fileDataStream)
throws CommonSystemException
fileDataStream - the input stream returned by openStreamFromFilefileName - the name of the file
CommonSystemException
public void writeStringToFile(java.lang.String fileName,
java.lang.String data)
throws CommonUserException,
CommonSystemException
fileName - data -
CommonUserException - if the File already exists
CommonSystemException
public void replaceWriteStringToFile(java.lang.String fileName,
java.lang.String data)
throws CommonUserException,
CommonSystemException
fileName - data -
CommonUserException - if the File already exists
CommonSystemException
public void writeByteArrayToFile(java.lang.String fileName,
byte[] data)
throws CommonUserException,
CommonSystemException
fileName - data -
CommonUserException - if the File already exists
CommonSystemException
public java.io.OutputStream openStreamToFile(java.lang.String fileName)
throws CommonUserException,
CommonSystemException
fileName -
CommonUserException
CommonSystemException
public void closeStreamToFile(java.lang.String fileName,
java.io.OutputStream fileDataStream)
throws CommonSystemException
fileDataStream - the output stream returned by openStreamToFilefileName - the name of the file
CommonSystemException
public void deleteFile(java.lang.String fileName)
throws CommonUserException,
CommonSystemException
fileName -
CommonUserException - if the file does not exist
CommonSystemException
public void renameFile(java.lang.String fileName,
java.lang.String newFileName)
throws CommonUserException,
CommonSystemException
fileName - newFileName -
CommonUserException - if the file does not exist
CommonSystemException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||