public final class FileUtils
extends java.lang.Object
| Constructor and Description |
|---|
FileUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
createDirectories(java.lang.String location,
java.lang.String... dirsToCreate) |
static void |
deleteDirectory(java.io.File folder)
Deprecated.
use
deleteDirectory(Path) instead. |
static void |
deleteDirectory(java.nio.file.Path folder)
Delete the given directory
|
static void |
deleteExclude(java.io.File toDelete,
java.io.File... excludes)
Deprecated.
use
deleteExclude(Path, Path...) instead. |
static void |
deleteExclude(java.nio.file.Path toDelete,
java.nio.file.Path... excludes)
Delete the file if it isn't in excluded files.
|
static long |
getCRC32(java.io.File file)
Deprecated.
use
getCRC32(Path) instead. |
static long |
getCRC32(java.nio.file.Path path)
Get the CRC32 of a File.
|
static java.lang.String |
getFileExtension(java.io.File file)
Deprecated.
use
getFileExtension(Path) instead. |
static java.lang.String |
getFileExtension(java.nio.file.Path path)
Get the extension of the given path.
|
static java.io.File |
getFilePathOfClass(java.lang.Class<?> classToGetPath) |
static long |
getFileSizeBytes(java.io.File file)
Deprecated.
Deprecated since 1.2.7. Use
getFileSizeBytes(Path) instead. |
static long |
getFileSizeBytes(java.nio.file.Path path) |
static long |
getFileSizeKiloBytes(java.io.File file)
Deprecated.
Deprecated since 1.2.7. Use
getFileSizeKiloBytes(Path) instead. |
static long |
getFileSizeKiloBytes(java.nio.file.Path path) |
static long |
getFileSizeMegaBytes(java.io.File file)
Deprecated.
Deprecated since 1.2.7. Use
getFileSizeMegaBytes(Path) instead. |
static long |
getFileSizeMegaBytes(java.nio.file.Path path) |
static java.lang.String |
getMD5(java.nio.file.Path path)
Get the MD5 of the given path.
|
static java.lang.String |
getMD5ofFile(java.io.File file)
Deprecated.
use
getMD5(Path) instead. |
static java.lang.String |
getSHA1(java.io.File file)
Deprecated.
use
getSHA1(Path) instead. |
static java.lang.String |
getSHA1(java.nio.file.Path path)
Get the SHA1 of the given path.
|
static java.lang.String |
getStringPathOfClass(java.lang.Class<?> classToGetPath) |
static java.lang.String |
hashInput(java.io.InputStream input,
java.lang.String method) |
static java.io.File[] |
list(java.io.File dir)
Deprecated.
use
list(Path) instead. |
static java.util.stream.Stream<java.nio.file.Path> |
list(java.nio.file.Path dir)
Get the list of all files in this directory (not recursively!)
|
static java.util.List<java.io.File> |
listRecursive(java.io.File directory)
Deprecated.
use
listRecursive(Path) instead. |
static java.util.List<java.nio.file.Path> |
listRecursive(java.nio.file.Path directory)
Return all files in the directory (recursively!)
|
static java.io.File |
removeExtension(java.io.File file)
Deprecated.
use
removeExtension(Path) instead. |
static java.nio.file.Path |
removeExtension(java.nio.file.Path path)
Remove the extension of the given path.
|
static java.lang.String |
removeExtension(java.lang.String fileName) |
@Deprecated public static java.lang.String getFileExtension(java.io.File file)
getFileExtension(Path) instead.file - given file.@Deprecated
public static java.io.File removeExtension(java.io.File file)
throws java.io.IOException
removeExtension(Path) instead.file - given file.java.io.IOException - if an I/O error occurred.public static java.lang.String removeExtension(java.lang.String fileName)
public static java.lang.String getFileExtension(java.nio.file.Path path)
path - given path.public static java.nio.file.Path removeExtension(java.nio.file.Path path)
throws java.io.IOException
path - given path.java.io.IOException - if an I/O error occurred.@Deprecated public static void deleteDirectory(java.io.File folder)
deleteDirectory(Path) instead.folder - folder to delete.public static void deleteDirectory(java.nio.file.Path folder)
throws java.io.IOException
folder - folder to delete.java.io.IOException - if an I/O error occurred.@Deprecated
public static void deleteExclude(java.io.File toDelete,
java.io.File... excludes)
deleteExclude(Path, Path...) instead.toDelete - the file to delete.excludes - whitelistpublic static void deleteExclude(java.nio.file.Path toDelete,
java.nio.file.Path... excludes)
throws java.io.IOException
toDelete - the file to delete.excludes - whitelistjava.io.IOException - if an I/O error occurred.@Deprecated public static java.util.List<java.io.File> listRecursive(java.io.File directory)
listRecursive(Path) instead.directory - the directory to process.public static java.util.List<java.nio.file.Path> listRecursive(java.nio.file.Path directory)
throws java.io.IOException
directory - the directory to process.java.io.IOException - if an I/O error occurred.public static void createDirectories(java.lang.String location,
java.lang.String... dirsToCreate)
throws java.io.IOException
java.io.IOException@Deprecated public static long getFileSizeMegaBytes(java.io.File file)
getFileSizeMegaBytes(Path) instead.file - the file to process.@Deprecated public static long getFileSizeKiloBytes(java.io.File file)
getFileSizeKiloBytes(Path) instead.file - the file to process.@Deprecated public static long getFileSizeBytes(java.io.File file)
getFileSizeBytes(Path) instead.file - the file to process.public static long getFileSizeMegaBytes(java.nio.file.Path path)
throws java.io.IOException
java.io.IOExceptionpublic static long getFileSizeKiloBytes(java.nio.file.Path path)
throws java.io.IOException
java.io.IOExceptionpublic static long getFileSizeBytes(java.nio.file.Path path)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String getStringPathOfClass(java.lang.Class<?> classToGetPath)
public static java.io.File getFilePathOfClass(java.lang.Class<?> classToGetPath)
public static java.lang.String hashInput(java.io.InputStream input,
java.lang.String method)
throws java.security.NoSuchAlgorithmException,
java.io.IOException
java.security.NoSuchAlgorithmExceptionjava.io.IOException@Deprecated
public static java.lang.String getMD5ofFile(java.io.File file)
throws java.io.IOException
getMD5(Path) instead.file - the file to process.java.io.IOException - is an I/O error occurred.public static java.lang.String getMD5(java.nio.file.Path path)
throws java.io.IOException
path - the path to process.java.io.IOException - is an I/O error occurred.@Deprecated
public static java.lang.String getSHA1(java.io.File file)
throws java.io.IOException
getSHA1(Path) instead.file - the file to process.java.io.IOException - is an I/O error occurred.public static java.lang.String getSHA1(java.nio.file.Path path)
throws java.io.IOException
path - the path to process.java.io.IOException - is an I/O error occurred.@Deprecated public static java.io.File[] list(java.io.File dir)
list(Path) instead.dir - the dir to process.public static java.util.stream.Stream<java.nio.file.Path> list(java.nio.file.Path dir)
throws java.io.IOException
dir - the dir to process.java.io.IOException - if an I/O error occurred.@Deprecated
public static long getCRC32(java.io.File file)
throws java.io.IOException
getCRC32(Path) instead.file - the file to processjava.io.IOException - is an I/O error occurred.public static long getCRC32(java.nio.file.Path path)
throws java.io.IOException
path - the path to processjava.io.IOException - is an I/O error occurred.