Class FSUtil

java.lang.Object
org.kingdoms.utils.FSUtil

public final class FSUtil extends Object
  • Field Details

  • Constructor Details

    • FSUtil

      public FSUtil()
  • Method Details

    • countEntriesOf

      public static int countEntriesOf(Path folder)
      There's no better way in Java. We're bound by this stupid encapsulation of Java.
    • standardWriter

      public static BufferedWriter standardWriter(Path path) throws IOException
      Mainly here because of Kotlin's stupid unnecessary checks and that array copy for varargs.
      Throws:
      IOException
    • countEntriesOf

      public static int countEntriesOf(Path folder, Predicate<Path> filter)
    • findSlotForCounterFile

      public static Path findSlotForCounterFile(Path folder, String prefix, String extension)
    • findSlotForCounterFolder

      public static Path findSlotForCounterFolder(Path folder, String prefix)
    • isFolderEmpty

      public static boolean isFolderEmpty(Path folder)
    • deleteFolder

      public static void deleteFolder(Path folder)
      Deletes a folder entirely if it exists.
    • deleteAllFileTypes

      public static void deleteAllFileTypes(Path folder, String type)
    • transfer

      public static void transfer(InputStream in, OutputStream out) throws IOException
      Throws:
      IOException
    • copyFolder

      public static void copyFolder(Path source, Path destination)