Class FileUtils

java.lang.Object
org.yamcs.utils.FileUtils

public class FileUtils extends Object
  • Constructor Details

    • FileUtils

      public FileUtils()
  • Method Details

    • copyRecursively

      public static void copyRecursively(Path source, Path target, CopyOption... options) throws IOException
      Throws:
      IOException
    • deleteRecursively

      public static void deleteRecursively(Path dirToRemove) throws IOException
      Throws:
      IOException
    • deleteRecursivelyIfExists

      public static void deleteRecursivelyIfExists(Path path) throws IOException
      Throws:
      IOException
    • deleteContents

      public static void deleteContents(Path directory) throws IOException
      Throws:
      IOException
    • writeAtomic

      public static void writeAtomic(Path file, byte[] bytes) throws IOException
      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