public class FileUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
copyFile(File sourceFile,
File targetFile)
Copies the specified sourceFile to the specified targetFile.
|
static FileReadOnlyHandler |
getFileReadOnlyHandler()
Returns the current FileReadOnlyHandler used by setFileReadOnly().
|
static void |
renameFile(File orig,
File dest)
Do the best to rename the file.
|
static void |
setFileReadOnly(File file,
boolean readOnly)
Sets the specified file read-only (readOnly == true) or writable
(readOnly == false).
|
static void |
setFileReadOnlyHandler(FileReadOnlyHandler fileReadOnlyHandler)
Sets the specified fileReadOnlyHandler to be used with setFileReadOnly().
|
public static FileReadOnlyHandler getFileReadOnlyHandler()
public static void setFileReadOnlyHandler(FileReadOnlyHandler fileReadOnlyHandler)
public static void setFileReadOnly(File file, boolean readOnly) throws IOException
IOException
- if the operation failedpublic static void copyFile(File sourceFile, File targetFile) throws IOException
IOException
public static void renameFile(File orig, File dest) throws IOException
orig
- regular filedest
- regular file (if exists it's rewritten)IOException
Copyright © 2016. All rights reserved.