Class DirUtil


  • public abstract class DirUtil
    extends Object
    • Constructor Detail

      • DirUtil

        public DirUtil()
    • Method Detail

      • getSubDirs

        public static List<File> getSubDirs​(File file)
      • 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
      • getVerifiedDir

        public static File getVerifiedDir​(String _dirPath)
      • 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
      • 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
      • getDirFolderList

        public static String[] getDirFolderList​(String dirPath)
      • getFileList

        public static String[] getFileList​(String dirPath)
        Lists files and directories using String[] list() method
      • getPath

        public static File getPath​(String dirPath)
      • dirFilesWithSubDir

        public static File[] dirFilesWithSubDir​(String dirPath)
      • filesWithSubDir

        public static List<File> filesWithSubDir​(String dirPath)
      • deletePosDataFile

        public static void deletePosDataFile​(File file,
                                             int offSet)
      • getSubDirectories

        public static Vector getSubDirectories​(File dir,
                                               boolean isImmediate)
      • getSubDirectories

        public static Vector getSubDirectories​(File dir)
      • getMatchingDirectoriesForAPattern

        public static Vector getMatchingDirectoriesForAPattern​(String pattern)
      • getMatchingDirectoriesForAPatternAlternateWay

        public static Vector getMatchingDirectoriesForAPatternAlternateWay​(String pattern)
      • getDirTokens

        public static Vector getDirTokens​(File dir)
      • getDestinationDirectory

        public static File getDestinationDirectory​(File sourceDir,
                                                   String sourcePattern,
                                                   String destPattern)
      • getDirTokens

        public static Vector getDirTokens​(String dirPath)
      • isDirPatternMatch

        public static boolean isDirPatternMatch​(Vector baseDirTokens,
                                                Vector dirTokens)
      • removeDir

        public static boolean removeDir​(File dir)