java.lang.Object
org.yamcs.utils.FileUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyRecursively(Path source, Path target, CopyOption... options) static voiddeleteContents(Path directory) static voiddeleteRecursively(Path dirToRemove) static voidstatic StringgetFileExtension(Path file) Return the extension for a file.static voidwriteAtomic(Path file, byte[] bytes) Writes bytes to a file in two phases via a temporary file in the same folder.
-
Constructor Details
-
FileUtils
public FileUtils()
-
-
Method Details
-
copyRecursively
public static void copyRecursively(Path source, Path target, CopyOption... options) throws IOException - Throws:
IOException
-
deleteRecursively
- Throws:
IOException
-
deleteRecursivelyIfExists
- Throws:
IOException
-
deleteContents
- Throws:
IOException
-
writeAtomic
Writes bytes to a file in two phases via a temporary file in the same folder. This will either succeed or fail and leave the original file in place.- Throws:
IOException
-
getFileExtension
Return the extension for a file. Always in lowercase.
-