public final class FileUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
close(@Nullable Closeable closeable)
Close the given
Closeable instance, ignoring nulls, and
logging any thrown IOException. |
static @NotNull File |
createTempDirectory(@Nullable File base)
Creates a unique temporary directory in the given directory.
|
static boolean |
delete(@Nullable File file)
Deletes a file.
|
static @NotNull String |
getBitBucket()
Return the bit bucket for the OS.
|
static @Nullable String |
getFileExtension(@NotNull String fileName)
Returns the (lowercase) file extension for a specified file.
|
static File |
getResourceAsFile(String resource)
Returns a File object for the given resource.
|
static @Nullable InputStream |
getResourceAsStream(@NotNull String resource)
Gets the
InputStream for this resource. |
@Nullable public static @Nullable String getFileExtension(@NotNull @NotNull String fileName)
fileName - the file name to retrieve the file extension from.public static boolean delete(@Nullable
@Nullable File file)
file - the File to delete@NotNull public static @NotNull File createTempDirectory(@Nullable @Nullable File base) throws IOException
base - the base directory to create a temporary directory withinIOException - thrown when a directory cannot be created
within the base directory@NotNull public static @NotNull String getBitBucket()
public static void close(@Nullable
@Nullable Closeable closeable)
Closeable instance, ignoring nulls, and
logging any thrown IOException.closeable - to be closed@Nullable public static @Nullable InputStream getResourceAsStream(@NotNull @NotNull String resource)
InputStream for this resource.resource - pathCopyright © 2012–2020 OWASP. All rights reserved.