Class FileUtil
java.lang.Object
de.pirckheimer_gymnasium.engine_pi.util.FileUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringThis method combines the specified basepath with the parts provided as arguments.static voidstatic booleanstatic booleanfindFilesByExtension(List<String> fileNames, Path dir, String extension) static StringgetExtension(File file) static StringgetExtension(String path) static StringgetFileName(String path) static StringgetFileName(String path, boolean extension) static StringgetFileName(URL path) static StringgetHome()https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/lang/System.html#getProperties()static StringgetParentDirPath(String uri) static StringgetParentDirPath(URI uri) static StringhumanReadableByteCount(long bytes) static StringhumanReadableByteCount(long bytes, boolean decimal) static StringnormalizePath(String path) Ersetzt im gegebenen Dateipfad alle Schrägstriche (Slashes) und Gegenschrägstriche (Backslashes) mit dem Zeichen des AttributsFile.separator.
-
Method Details
-
deleteDir
-
findFilesByExtension
-
findFiles
-
getExtension
-
getExtension
-
getFileName
-
getFileName
-
getFileName
-
getParentDirPath
-
getParentDirPath
-
combine
This method combines the specified basepath with the parts provided as arguments. The output will use the path separator of the current system;- Parameters:
basePath- The base path for the combined path.paths- The parts of the path to be constructed.- Returns:
- The combined path.
-
humanReadableByteCount
-
humanReadableByteCount
-
normalizePath
Ersetzt im gegebenen Dateipfad alle Schrägstriche (Slashes) und Gegenschrägstriche (Backslashes) mit dem Zeichen des AttributsFile.separator.- Parameters:
path- Ein Dateipfad, der Schrägstriche oder Gegenschrägstriche enthalten kann.- Returns:
- Der normalisierte Dateipfad.
-
exists
-
getHome
https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/lang/System.html#getProperties() -
createDir
-