public final class FileSystemUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
appendFileContents(File toAppend,
File srcFile)
Reads the contents from source file and append its contents to append file.
|
static void |
closeFile(File file)
Closes the file handle for temporary file with file deletion.
|
static void |
closeFile(File file,
boolean toBeDeleted)
Closes the file handle for temporary file.
|
static String |
readAppendFile(String toAppend,
String spaces)
Reads file and convert it to string.
|
static void |
updateFileHandle(File inputFile,
String contentTobeAdded,
boolean isClose)
Updates the generated file handle.
|
public static void appendFileContents(File toAppend, File srcFile) throws IOException
toAppend - destination file in which the contents of source file is appendedsrcFile - source file from which data is read and added to to append fileIOException - any IO errorspublic static String readAppendFile(String toAppend, String spaces) throws IOException
toAppend - file to be convertedspaces - spaces to be appendedIOException - when fails to convert to stringpublic static void updateFileHandle(File inputFile, String contentTobeAdded, boolean isClose) throws IOException
inputFile - input filecontentTobeAdded - content to be appended to the fileisClose - when close of file is called.IOException - if the named file exists but is a directory rather than a regular file, does not exist but
cannot be created, or cannot be opened for any other reasonpublic static void closeFile(File file, boolean toBeDeleted) throws IOException
file - file to be closedtoBeDeleted - flag to indicate if file needs to be deletedIOException - when failed to close the file handlepublic static void closeFile(File file) throws IOException
file - file to be closedIOException - when failed to close the file handleCopyright © 2017. All rights reserved.