Package org.kingdoms.utils
Class FSUtil
java.lang.Object
org.kingdoms.utils.FSUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyFolder(Path source, Path destination) static intcountEntriesOf(Path folder) There's no better way in Java.static intcountEntriesOf(Path folder, Predicate<Path> filter) static voiddeleteAllFileTypes(Path folder, String type) static voiddeleteFolder(Path folder) Deletes a folder entirely if it exists.static PathfindSlotForCounterFile(Path folder, String prefix, String extension) static PathfindSlotForCounterFolder(Path folder, String prefix) static booleanisFolderEmpty(Path folder) static BufferedWriterstandardWriter(Path path) Mainly here because of Kotlin's stupid unnecessary checks and that array copy for varargs.static voidtransfer(InputStream in, OutputStream out)
-
Field Details
-
STD_WRITER
-
-
Constructor Details
-
FSUtil
public FSUtil()
-
-
Method Details
-
countEntriesOf
There's no better way in Java. We're bound by this stupid encapsulation of Java. -
standardWriter
Mainly here because of Kotlin's stupid unnecessary checks and that array copy for varargs.- Throws:
IOException
-
countEntriesOf
-
findSlotForCounterFile
-
findSlotForCounterFolder
-
isFolderEmpty
-
deleteFolder
Deletes a folder entirely if it exists. -
deleteAllFileTypes
-
transfer
- Throws:
IOException
-
copyFolder
-