public class FileUtil extends Object
Constructor and Description |
---|
FileUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
closeQuetly(Closeable closeable)
Unconditionally close a
Closeable . |
boolean |
fileExists(String filepath)
Check if the input filename (fully qualified path) exists or not.
|
long |
getFileAge(String fileName)
Return age of the input file in milliseconds.
|
String |
readFileNewLine(String fileName)
Reads the data from the input fileName and appends a /n after each line read.
|
void |
storeFile(String file,
String data)
Creates a file and persists the input data
|
public void storeFile(String file, String data) throws IOException
file
- The file to createdata
- The data to store in the fileIOException
- If creating the file or persisting the data in the file failspublic boolean fileExists(String filepath)
filepath
- String The fully qualified path and name of a filepublic String readFileNewLine(String fileName) throws BIDException
fileName
- String The file to readBIDException
- If reading the file failspublic long getFileAge(String fileName)
fileName
- String file to checkpublic static void closeQuetly(Closeable closeable)
Closeable
. Any exceptions will be ignored.closeable
- the object to close, may be null or already closedCopyright © 2017 Nets Branch Norway. All Rights Reserved.