- java.lang.Object
-
- tech.fastj.resources.files.FileUtil
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getFileExtension(Path filePath)
Gets the file extension of the specified path.static List<String>
readFileLines(Path filePath)
Reads all lines of a file, as an abstraction ofFiles.readAllLines(Path)
which handles the possibleIOException
.
-
-
-
Method Detail
-
getFileExtension
public static String getFileExtension(Path filePath)
Gets the file extension of the specified path.This method does not account for file extensions with more than one dot (
.
) -- in cases like those, only the last part of the extension will be returned.For paths which contain no file extension, an empty
String
will be returned.- Parameters:
filePath
- ThePath
to get the file extension of.- Returns:
- The
Path
's file extension.
-
readFileLines
public static List<String> readFileLines(Path filePath)
Reads all lines of a file, as an abstraction ofFiles.readAllLines(Path)
which handles the possibleIOException
.- Parameters:
filePath
- ThePath
of the file to read.- Returns:
- The lines of the file.
-
-