Package ch.njol.skript.util
Class FileUtils
java.lang.Object
ch.njol.skript.util.FileUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic File
static void
static String
static File
static Collection<File>
static void
save(InputStream in, File file)
Saves the contents of an InputStream in a file.
-
Method Details
-
getBackupSuffix
- Returns:
- The current date and time
-
backup
- Throws:
IOException
-
move
- Throws:
IOException
-
copy
- Throws:
IOException
-
renameAll
public static Collection<File> renameAll(File directory, Converter<String,String> renamer) throws IOException- Parameters:
directory
-renamer
- Renames files. Return null to leave a file as-is.- Returns:
- A collection of all changed files (with their new names)
- Throws:
IOException
- If renaming one of the files caused an IOException. Some files might have been renamed already.
-
save
Saves the contents of an InputStream in a file.- Parameters:
in
- The InputStream to read from. This stream will not be closed when this method returns.file
- The file to save to. Will be replaced if it exists, or created if it doesn't.- Throws:
IOException
-