public class FileUtils extends FileUtilsV2_2
EMPTY_FILE_ARRAY, ONE_EB, ONE_GB, ONE_KB, ONE_MB, ONE_PB, ONE_TB, ONE_YB, ONE_ZB
Constructor and Description |
---|
FileUtils()
Instances should NOT be constructed in standard programming.
|
Modifier and Type | Method and Description |
---|---|
static void |
copy(File file,
OutputStream out)
Copies the given file into an output stream.
|
static void |
copy(InputStream in,
File file)
Copies the given input stream into a file.
|
static File |
getTempFileFor(File file)
Find a non-existing file in the same directory using the same name as prefix.
|
cleanDirectory, contentEquals, copyDirectory, copyDirectory, copyDirectory, copyFile, copyFile, copyFileToDirectory, copyFileToDirectory, deleteDirectory, deleteQuietly, forceDelete, forceDeleteOnExit, forceMkdir, isSymlink, moveDirectory, moveFile, openInputStream, openOutputStream, openOutputStream, readFileToString, readFileToString, sizeOf, sizeOfDirectory
public FileUtils()
public static void copy(File file, OutputStream out) throws IOException
file
- input file (must exist).out
- output stream.IOException
- if file is not found or copying failspublic static void copy(InputStream in, File file) throws IOException
The target file must not be a directory and its parent must exist.
in
- source stream.file
- output file to be created or overwritten.IOException
- if file is not found or copying failspublic static File getTempFileFor(File file)
file
- file used for the name and location (it is not read or written).Copyright © 2017 ZeroTurnaround. All rights reserved.