public class FileUtils extends Object
| Constructor and Description |
|---|
FileUtils() |
| Modifier and Type | Method and Description |
|---|---|
static File |
createUniqueFile(File directory,
String filename)
Creates a File that is unique in the specified directory.
|
static String |
getFilenameFromContentDisposition(javax.ws.rs.core.Response response)
Get the filename from the "Content-Disposition" header of a JAX-RS response.
|
static String |
readFileContents(File file)
Reads the contents of a File to a String.
|
public static File createUniqueFile(File directory, String filename) throws IOException
directory - the directory to create the file infilename - the base filename with extensionIOException - if any error occurs during file creationpublic static String getFilenameFromContentDisposition(javax.ws.rs.core.Response response)
response - the JAX-RS Response instance to get the "Content-Disposition" header filename frompublic static String readFileContents(File file) throws IOException
file - the File instance to read the contents fromIOException - if any errors occur while opening or reading the fileCopyright © 2017. All rights reserved.