Package org.brijframework.util.location
Class DirUtil
- java.lang.Object
-
- org.brijframework.util.location.DirUtil
-
public abstract class DirUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description DirUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancleanDir(File dir)clean directory form pathstatic booleancreateFile(String file)static booleancreateFolder(File logDir)create new folder in given pathstatic booleancreateFolder(String folder)create new folder in given pathstatic voiddeleteAllFile(File file, int offSet)static voiddeleteDir(File file)static voiddeletePosDataFile(File file, int offSet)static File[]dirFilesWithSubDir(String dirPath)static booleanensureDirExists(File dir)static List<File>filesWithSubDir(String dirPath)static FilegetDestinationDirectory(File sourceDir, String sourcePattern, String destPattern)static FilegetDir(String dirPath)create new file in given pathstatic List<File>getDirFiles(String dirPath)get total file in dirstatic String[]getDirFolderList(String dirPath)static List<File>getDirFolders(String dirPath)get total folder in dirstatic FilegetDirPath(String dirPath)static VectorgetDirTokens(File dir)static VectorgetDirTokens(String dirPath)static VectorgetDirTokens(String dirPath, String delim)static booleangetFileExists(String path)static FilegetFileExists(String dir, String fileName)static String[]getFileList(String dirPath)Lists files and directories using String[] list() methodstatic StringgetFilePath(String dir, String fileName)static VectorgetMatchingDirectoriesForAPattern(String pattern)static VectorgetMatchingDirectoriesForAPatternAlternateWay(String pattern)static FilegetPath(String dirPath)static VectorgetSubDirectories(File dir)static VectorgetSubDirectories(File dir, boolean isImmediate)static List<File>getSubDirs(File file)static List<File>getSubDirs(List<File> subDirs, File file)static FilegetVerifiedDir(String _dirPath)static booleanisDirPatternMatch(Vector baseDirTokens, Vector dirTokens)static booleanisFile(File file)check is file or notstatic booleanisFolder(File folder)check is folder or notstatic booleanremoveDir(File dir)static booleanremoveFile(File file)remove file form directorystatic booleanremoveFolder(File folder)remove directory form pathstatic voidrenameDir(File file)remove directory form path
-
-
-
Method Detail
-
ensureDirExists
public static boolean ensureDirExists(File dir)
-
isFile
public static boolean isFile(File file)
check is file or not- Parameters:
file-- Returns:
- boolean
-
isFolder
public static boolean isFolder(File folder)
check is folder or not- Parameters:
folder-- Returns:
- boolean
-
createFolder
public static boolean createFolder(String folder)
create new folder in given path- Parameters:
folder-- Returns:
- boolean
-
createFolder
public static boolean createFolder(File logDir)
create new folder in given path- Parameters:
folder-- Returns:
- boolean
-
getDir
public static File getDir(String dirPath)
create new file in given path- Parameters:
file-- Returns:
- boolean
-
createFile
public static boolean createFile(String file)
-
removeFile
public static boolean removeFile(File file)
remove file form directory- Parameters:
file-- Returns:
- boolean
-
removeFolder
public static boolean removeFolder(File folder)
remove directory form path- Parameters:
foler-- Returns:
- boolean
-
getFilePath
public static String getFilePath(String dir, String fileName) throws FileNotFoundException
- Throws:
FileNotFoundException
-
getFileExists
public static File getFileExists(String dir, String fileName) throws FileNotFoundException
- Throws:
FileNotFoundException
-
getFileExists
public static boolean getFileExists(String path)
-
renameDir
public static void renameDir(File file)
remove directory form path- Parameters:
dir-
-
deleteDir
public static void deleteDir(File file)
-
deleteAllFile
public static void deleteAllFile(File file, int offSet)
-
cleanDir
public static boolean cleanDir(File dir)
clean directory form path- Parameters:
dir-- Returns:
- boolean
-
getDirFiles
public static List<File> getDirFiles(String dirPath)
get total file in dir- Parameters:
dirPath-- Returns:
- File List
-
getDirFolders
public static List<File> getDirFolders(String dirPath)
get total folder in dir- Parameters:
dirPath-- Returns:
- List
-
getFileList
public static String[] getFileList(String dirPath)
Lists files and directories using String[] list() method
-
getDirPath
public static File getDirPath(String dirPath) throws FileNotFoundException
- Throws:
FileNotFoundException
-
deletePosDataFile
public static void deletePosDataFile(File file, int offSet)
-
getMatchingDirectoriesForAPattern
public static Vector getMatchingDirectoriesForAPattern(String pattern)
-
getMatchingDirectoriesForAPatternAlternateWay
public static Vector getMatchingDirectoriesForAPatternAlternateWay(String pattern)
-
getDestinationDirectory
public static File getDestinationDirectory(File sourceDir, String sourcePattern, String destPattern)
-
removeDir
public static boolean removeDir(File dir)
-
-