Class FileUtils
java.lang.Object
org.variantsync.diffdetective.util.FileUtils
Utility functions for handling file paths.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PathaddExtension(Path p, String extension) Addsextensionto the filename ofp.static booleanhasExtension(Path p, String expected) Checks ifphas the file extensionexpected.static booleanReturnstrueiffpcan be created or is an empty directory.static booleanisLineGraph(Path p) Check if the pathphas a line graph extension.listAllFilesRecursively(Path directory) Returns a list of all regular files inside/belowdirectory.static StringreplaceLineEndings(String text, String replacee) Replace the line endings of any operating system intextbyreplacestatic booleanReturnstrueifpcan be created or is an empty directory.
-
Constructor Details
-
FileUtils
public FileUtils()
-
-
Method Details
-
replaceLineEndings
Replace the line endings of any operating system intextbyreplace -
isEmptyDirectory
Returnstrueiffpcan be created or is an empty directory.- Throws:
IOException- if the file system signals an error
-
tryIsEmptyDirectory
Returnstrueifpcan be created or is an empty directory. If the file system signals an error, this function returnsfalse. -
listAllFilesRecursively
Returns a list of all regular files inside/belowdirectory.- Throws:
IOException- if the file system signals an error
-
hasExtension
Checks ifphas the file extensionexpected. Note that the common dot delimiter has to be included inexpected. -
isLineGraph
Check if the pathphas a line graph extension. -
addExtension
Addsextensionto the filename ofp. Note that the common dot delimiter has to be included inextension.
-