public class RMFileUtils
extends java.lang.Object
Constructor and Description |
---|
RMFileUtils() |
Modifier and Type | Method and Description |
---|---|
static java.io.File |
copyFile(java.io.File aSource,
java.io.File aDest)
Copies a file from one location to another.
|
static java.io.File |
copyFileSafe(java.io.File in,
java.io.File out)
Copies a file from one location to another with exception suppression.
|
static boolean |
deleteDeep(java.io.File aFile)
Deletes a directory.
|
static java.io.File |
getAppDataDir(java.lang.String aName,
boolean doCreate)
Returns the AppData or Application Support directory file.
|
static byte[] |
getBytes(java.io.File aFile)
Returns bytes for a file.
|
static java.io.File |
getDirectory(java.io.File aParent,
java.lang.String aChild,
boolean create)
Returns a child directory for a parent directory, creating if necessary.
|
static java.io.File |
getFile(java.lang.Object aSource)
Returns a File object from a source, if one can be divined.
|
static java.lang.String |
getFileExtension(java.io.File aFile)
Returns the file name for a file.
|
static java.lang.String |
getFileName(java.io.File aFile)
Returns the file name for a file.
|
static java.lang.String |
getFileNameSimple(java.io.File aFile)
Returns the file name for a file.
|
static java.lang.String |
getPath(java.io.File aFile)
Returns the path for a file.
|
static java.io.File |
getTempDir()
Returns the temp directory.
|
static java.io.File |
getTempFile(java.lang.String aName)
Creates a file in the temp directory.
|
static java.io.File |
getUniqueFile(java.io.File aFile)
Returns a unique non-existent file for given file.
|
static java.io.File |
getUnpackDestination(java.io.File aFile,
java.io.File aDestFile)
Returns the file that given packed file would be saved to using the unpack method.
|
static java.io.File |
getUserHomeDir(java.lang.String aName,
boolean doCreate)
Returns a file for named directory in the user's home directory (with option to create).
|
static boolean |
isFileType(java.io.File aFile,
java.lang.String... theTypes)
Returns whether file is given type.
|
static boolean |
isPacked(java.io.File aFile)
Returns whether given file is packed with pack200.
|
static void |
openFile(java.io.File aFile)
Tries to open the given file name with the platform reader.
|
static void |
openFile(java.lang.String aName)
Tries to open the given file name with the platform reader.
|
static java.io.File |
unpack(java.io.File aFile,
java.io.File aDestFile)
Unpacks the given file into the destination file.
|
static void |
unzip(java.io.File aFile)
Unzips the given file into the destination file.
|
static void |
writeBytes(java.io.File aFile,
byte[] theBytes)
Writes the given bytes (within the specified range) to the given file.
|
static void |
writeBytesSafely(java.io.File aFile,
byte[] theBytes)
Writes the given bytes (within the specified range) to the given file, with an option for doing it "safely".
|
public static java.io.File getFile(java.lang.Object aSource)
public static java.lang.String getPath(java.io.File aFile)
public static java.lang.String getFileName(java.io.File aFile)
public static java.lang.String getFileNameSimple(java.io.File aFile)
public static java.lang.String getFileExtension(java.io.File aFile)
public static boolean isFileType(java.io.File aFile, java.lang.String... theTypes)
public static java.io.File getDirectory(java.io.File aParent, java.lang.String aChild, boolean create)
public static void openFile(java.io.File aFile)
public static void openFile(java.lang.String aName)
public static byte[] getBytes(java.io.File aFile)
public static void writeBytes(java.io.File aFile, byte[] theBytes) throws java.io.IOException
java.io.IOException
public static void writeBytesSafely(java.io.File aFile, byte[] theBytes) throws java.io.IOException
java.io.IOException
public static java.io.File getTempDir()
public static java.io.File getTempFile(java.lang.String aName)
public static java.io.File getUserHomeDir(java.lang.String aName, boolean doCreate)
public static java.io.File getAppDataDir(java.lang.String aName, boolean doCreate)
public static java.io.File copyFile(java.io.File aSource, java.io.File aDest) throws java.io.IOException
java.io.IOException
public static java.io.File copyFileSafe(java.io.File in, java.io.File out)
public static boolean deleteDeep(java.io.File aFile)
public static void unzip(java.io.File aFile)
public static boolean isPacked(java.io.File aFile)
public static java.io.File unpack(java.io.File aFile, java.io.File aDestFile)
public static java.io.File getUnpackDestination(java.io.File aFile, java.io.File aDestFile)
public static java.io.File getUniqueFile(java.io.File aFile)