public final class FileUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
close(Closeable closeable)
Close the given
Closeable instance, ignoring nulls, and logging
any thrown IOException. |
static File |
createTempDirectory(File base)
Creates a unique temporary directory in the given directory.
|
static boolean |
delete(File file)
Deletes a file.
|
static String |
getBitBucket()
Return the bit bucket for the OS.
|
static String |
getFileExtension(String fileName)
Returns the (lowercase) file extension for a specified file.
|
static File |
getTempFile(String prefix,
String extension)
Generates a new temporary file name that is guaranteed to be unique.
|
public static String getFileExtension(String fileName)
fileName - the file name to retrieve the file extension from.public static boolean delete(File file)
file - the File to deletepublic static File createTempDirectory(File base) throws IOException
base - the base directory to create a temporary directory withinIOException - thrown when a directory cannot be created within the
base directorypublic static File getTempFile(String prefix, String extension) throws IOException
prefix - the prefix for the file name to generateextension - the extension of the generated file nameIOException - thrown if the temporary folder could not be
createdpublic static String getBitBucket()
public static void close(Closeable closeable)
Closeable instance, ignoring nulls, and logging
any thrown IOException.closeable - to be closedCopyright? 2012-15 Jeremy Long. All Rights Reserved.