|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mancrd.ahah.commons.utils.FileUtils
public final class FileUtils
Method Summary | |
---|---|
static boolean |
copy(String srcPath,
String destPath)
Copies src file to dst file. |
static boolean |
deleteFile(String fullyQualifiedFileName)
|
static Object |
deserialize(File file)
|
static boolean |
fileExists(String pFilePath)
Checks if a file exists |
static String[] |
getAllFileNames(String dirName)
This method returns the names of all the files found in the given directory |
static String[] |
getAllFileNames(String dirName,
String regex)
This method returns the names of all the files found in the given directory matching the given regular expression. |
static File[] |
getAllFiles(String dirName)
This method returns the Files found in the given directory |
static File[] |
getAllFiles(String dirName,
String regex)
This method returns the files found in the given directory matching the given regular expression. |
static void |
mkDirIfNotExists(String pFilePath)
Makes a dir, if it doesn't already exist |
static String |
readFileFromClasspathToString(String fileName)
Given a File from the classpath, return the content of the file as a String |
static String |
readFileToString(String filePath)
Given a path to a File, return the content of the file as a String |
static void |
serialize(Object object,
String path)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String readFileToString(String filePath)
file
-
public static String readFileFromClasspathToString(String fileName)
fileName
-
public static Object deserialize(File file)
public static void serialize(Object object, String path)
public static String[] getAllFileNames(String dirName)
dirName
- - ex. "./images/colors/original/" *make sure you have the '/' on the end
public static File[] getAllFiles(String dirName)
dirName
- - ex. "./images/colors/original/" *make sure you have the '/' on the end
public static String[] getAllFileNames(String dirName, String regex)
dirName
- - ex. "./images/colors/original/" *make sure you have the '/' on the endregex
- - ex. ".*.png"
public static File[] getAllFiles(String dirName, String regex)
dirName
- - ex. "./images/colors/original/" *make sure you have the '/' on the endregex
- - ex. ".*.png"
public static boolean copy(String srcPath, String destPath)
srcPath
- destPath
-
IOException
public static boolean deleteFile(String fullyQualifiedFileName)
fullyQualifiedFileName
-
public static boolean fileExists(String pFilePath)
pFilePath
-
public static void mkDirIfNotExists(String pFilePath)
pFilePath
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |