Class FileUtils
java.lang.Object
org.variantsync.diffdetective.util.FileUtils
Utility functions for handling file paths.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Path
addExtension
(Path p, String extension) Addsextension
to the filename ofp
.static boolean
hasExtension
(Path p, String expected) Checks ifp
has the file extensionexpected
.static boolean
Returnstrue
iffp
can be created or is an empty directory.static boolean
isLineGraph
(Path p) Check if the pathp
has a line graph extension.listAllFilesRecursively
(Path directory) Returns a list of all regular files inside/belowdirectory
.static String
replaceLineEndings
(String text, String replacee) Replace the line endings of any operating system intext
byreplace
static boolean
Returnstrue
ifp
can be created or is an empty directory.
-
Constructor Details
-
FileUtils
public FileUtils()
-
-
Method Details
-
replaceLineEndings
Replace the line endings of any operating system intext
byreplace
-
isEmptyDirectory
Returnstrue
iffp
can be created or is an empty directory.- Throws:
IOException
- if the file system signals an error
-
tryIsEmptyDirectory
Returnstrue
ifp
can 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 ifp
has the file extensionexpected
. Note that the common dot delimiter has to be included inexpected
. -
isLineGraph
Check if the pathp
has a line graph extension. -
addExtension
Addsextension
to the filename ofp
. Note that the common dot delimiter has to be included inextension
.
-