public class FileUtils extends Object
| Constructor and Description |
|---|
FileUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyFile(File src,
File dest)
Copy a file.
|
static byte[] |
getBytesFromClassesRoot(String fileName) |
static File |
getFileFromClassesRoot(String fileName)
Retrieve a file from the root of the classes directory.
|
static File |
getFileFromClassesRoot(String fileName,
Class relativeTo)
Retrieve a file from the root of the classes directory.
|
static InputStream |
getStreamFromClassesRoot(String fileName) |
static InputStream |
getStreamFromClassesRoot(String fileName,
Class relativeTo) |
static String |
getStringFromClassesRoot(String fileName) |
static boolean |
isSame(byte[] contents,
File toCheck) |
static byte[] |
readBytesFromFile(File f) |
static byte[] |
readBytesFromStream(InputStream in) |
static String |
readFileToString(File fInput) |
static void |
writeBytesToFile(byte[] data,
File fOutput) |
static void |
writeStringToFile(String strData,
File fOutput) |
public static void writeBytesToFile(byte[] data,
File fOutput)
throws IOException
IOExceptionpublic static File getFileFromClassesRoot(String fileName) throws FileNotFoundException
FileNotFoundExceptionpublic static File getFileFromClassesRoot(String fileName, Class relativeTo) throws FileNotFoundException
FileNotFoundExceptionpublic static InputStream getStreamFromClassesRoot(String fileName) throws FileNotFoundException
FileNotFoundExceptionpublic static InputStream getStreamFromClassesRoot(String fileName, Class relativeTo) throws FileNotFoundException
FileNotFoundExceptionpublic static byte[] getBytesFromClassesRoot(String fileName) throws IOException
IOExceptionpublic static String getStringFromClassesRoot(String fileName) throws IOException
IOExceptionpublic static byte[] readBytesFromStream(InputStream in) throws IOException
IOExceptionpublic static byte[] readBytesFromFile(File f) throws IOException
IOExceptionpublic static void writeStringToFile(String strData, File fOutput) throws IOException
IOExceptionpublic static String readFileToString(File fInput) throws IOException
IOExceptionpublic static boolean isSame(byte[] contents,
File toCheck)
throws IOException
IOExceptionpublic static void copyFile(File src, File dest) throws IOException
IOException"Copyright © 2010 - 2017 Adobe Systems Incorporated. All Rights Reserved"