public class FileHelper extends Object
| Constructor and Description |
|---|
FileHelper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getDestination(String workingDirectory,
String destinationPath)
Gives a destination.
|
static boolean |
isWindowsStartPath(String path)
Tells if the path is an absolute Windows one.
|
static String |
readFile(File source)
Read a file in a string.
|
static FileLinesIterable |
readFileLinesIteration(File file)
Opens a file and iterates over all the lines.
|
static FileLinesIterable |
readFileLinesIteration(String filePath)
Opens a file and iterates over all the lines.
|
static boolean |
saveFile(File destination,
String content) |
public static String getDestination(String workingDirectory, String destinationPath)
workingDirectory - the working directory if destinationPath is relative. It must
end with the path separator.destinationPath - the destinationPathpublic static boolean isWindowsStartPath(String path)
path - the pathpublic static String readFile(File source)
source - the source filepublic static FileLinesIterable readFileLinesIteration(File file) throws FileNotFoundException
file - the fileFileNotFoundException - FileNotFoundExceptionpublic static FileLinesIterable readFileLinesIteration(String filePath) throws FileNotFoundException
filePath - the absolute file pathFileNotFoundException - FileNotFoundExceptionCopyright © 2012. All Rights Reserved.