|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectiitb.con.util.FileUtil
public class FileUtil
File util to retrieve file meta information
Field Summary | |
---|---|
static java.lang.String |
FILE_DATA_PATH
File data path |
static java.lang.String |
FILE_SEPARATOR
File separator |
Constructor Summary | |
---|---|
FileUtil()
|
Method Summary | |
---|---|
static void |
copy(java.io.File src,
java.io.File dst)
Copy the file to the specified destination |
static boolean |
createDir(java.lang.String path)
Creates directory for the given path string |
static boolean |
createDirForFilePathString(java.lang.String name)
Creates the directory(-ies) for the given filepath string |
static Result |
createFile(java.lang.String name)
Create the file if it does not exists |
static boolean |
deleteDir(java.io.File dir)
Deletes the entire directory structure of the specified directory |
static boolean |
deleteDir(java.lang.String name)
Deletes the specified directory |
static boolean |
deleteFile(java.lang.String name)
Deletes the file if it exists |
static java.lang.String |
getName(java.lang.String name)
Gets the file name from the filepath string |
static boolean |
isFileExists(java.lang.String name)
Return true if file exists in the system |
static boolean |
renameMove(java.lang.String oldFullPathName,
java.lang.String newFullPathName)
Renames and move the file to the specified destination |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FILE_DATA_PATH
public static final java.lang.String FILE_SEPARATOR
Constructor Detail |
---|
public FileUtil()
Method Detail |
---|
public static void copy(java.io.File src, java.io.File dst) throws java.io.IOException
src
- file source namedst
- file destination name
java.io.IOException
- on failurepublic static boolean createDir(java.lang.String path)
path
- path string
public static boolean createDirForFilePathString(java.lang.String name)
name
- filepath string
public static Result createFile(java.lang.String name)
name
- file name
Result
public static boolean deleteDir(java.io.File dir)
dir
- directory
public static boolean deleteDir(java.lang.String name)
name
- directory name
public static boolean deleteFile(java.lang.String name)
name
- file name
public static java.lang.String getName(java.lang.String name)
Eg: Returns "filename.txt" for the string "/usr/test/filename.txt"
name
- filepath string
public static boolean isFileExists(java.lang.String name)
name
- file name
public static boolean renameMove(java.lang.String oldFullPathName, java.lang.String newFullPathName)
oldFullPathName
- old path name along with file namenewFullPathName
- new path name along with file name
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |