public class Files extends Object
Constructor and Description |
---|
Files() |
Modifier and Type | Method and Description |
---|---|
static void |
assertDirectoryExists(File file)
Throws an exception if the given file does not exist
|
static void |
assertExists(File file)
Throws an exception if the given file or directory does not exist
|
static void |
assertFileExists(File file)
Throws an exception if the given file does not exist
|
static void |
copy(File source,
File target)
|
static String |
getMimeType(File file) |
static String |
getRelativePath(File rootDir,
File file) |
static byte[] |
readBytes(File file)
Reads a
File and returns the data as a byte array |
static int |
recursiveDelete(File file)
Recursively deletes the given file whether its a file or directory returning the number
of files deleted
|
public static void copy(File source, File target) throws IOException
IOException
public static int recursiveDelete(File file)
public static String getRelativePath(File rootDir, File file) throws IOException
IOException
public static byte[] readBytes(File file) throws IOException
File
and returns the data as a byte arrayIOException
public static void assertExists(File file)
public static void assertFileExists(File file)
public static void assertDirectoryExists(File file)
Copyright © 2017 JBoss by Red Hat. All rights reserved.