public final class FileUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
getFileExtension(File file)
Parse extension of file from the name
|
static void |
processFileLines(String filePath,
String encoding,
java.util.function.Consumer<String> consumer)
Open file, which path transmitted in
filePath and process all rows by the consumer |
static void |
processFiles(File root,
java.util.function.Consumer<File> consumer)
Recursively finds all files in the folder
root
All found files will be processed by the consumer |
public static void processFiles(File root, java.util.function.Consumer<File> consumer)
root
All found files will be processed by the consumerroot - the path to the root directory of target files, it may be path to the single fileconsumer - function to process all found filespublic static void processFileLines(String filePath, String encoding, java.util.function.Consumer<String> consumer) throws IOException
filePath and process all rows by the consumerfilePath - the path target fileencoding - charset which will be used to read file contentconsumer - function to process lines of the fileIOExceptionCopyright © 2016. All Rights Reserved.