Class fFILETOOLS


  • public class fFILETOOLS
    extends Object
    file tools functions
    • Constructor Summary

      Constructors 
      Constructor Description
      fFILETOOLS()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean Copy​(String xSourceFilename, String xDestinationFilename)
      copy a file returns [true] = success, [false] = failed
      static boolean CopyDirectory​(String xDirSource, String xDirDestination)
      copy a directory returns [true] = success, [false] = failed
      static boolean Exist​(String xFilename)
      check if a file exists returns [true] = exist, [false] = not exist
      static String ExtractPartFromFileName​(String xFilename, int xPart)
      returns a portion of the file name xPart = 1 file name excluding extension, 2 = extension, 3 = filename, 4 = pathname
      static String[] FileListing​(String xDirectory)
      returns an array string containing the names of files and folders in the directory
      static String[] FileListing2​(String xDirectory, String xExtention)
      returns an array string containing the names of files in the directory
      static String FileSeparator()
      returns the file separator (e.g. "\" for Windows, "/" for Linux)
      static String[] FolderListing​(String xDirectory)
      returns an array string containing the names of folders in the directory
      static String GetLastModified​(String xFile, String xDateFormat)
      returns the last date of modified
      static boolean IsDirectory​(String xPathname)
      check if a path represents a folder
      static boolean IsFile​(String xPathname)
      check if a path represents a file
      static boolean Kill​(String xFilename)
      delete a file returns [true] = success, [false] = failed
      static boolean MKDir​(String xDirectoryname)
      create a directory returns [true] = success, [false] = failed
      static boolean MKDirs​(String xDirectorynames)
      create a directory and subdirectories returns [true] = success, [false] = failed
      static boolean Rename​(String xOldFilename, String xNewFilename)
      rename a file returns [true] = success, [false] = failed
      static boolean RMDir​(String xDirectoryname)
      remove a directory WARNING: all files in the directory will be deleted!
      static boolean SetLastModified​(String xFile, String xDateFormat, String xNewDateString)
      sets the date of modified returns [true] = success, [false] = failed
      static long Size​(String xFilename)
      returns the size of file in bytes
    • Constructor Detail

      • fFILETOOLS

        public fFILETOOLS()
    • Method Detail

      • Copy

        public static boolean Copy​(String xSourceFilename,
                                   String xDestinationFilename)
        copy a file returns [true] = success, [false] = failed
      • CopyDirectory

        public static boolean CopyDirectory​(String xDirSource,
                                            String xDirDestination)
        copy a directory returns [true] = success, [false] = failed
      • Exist

        public static boolean Exist​(String xFilename)
        check if a file exists returns [true] = exist, [false] = not exist
      • ExtractPartFromFileName

        public static String ExtractPartFromFileName​(String xFilename,
                                                     int xPart)
        returns a portion of the file name xPart = 1 file name excluding extension, 2 = extension, 3 = filename, 4 = pathname
      • FileListing

        public static String[] FileListing​(String xDirectory)
        returns an array string containing the names of files and folders in the directory
      • FileListing2

        public static String[] FileListing2​(String xDirectory,
                                            String xExtention)
        returns an array string containing the names of files in the directory
        Parameters:
        xDirectory - the directory path name
        xExtension - the filter for search
      • FileSeparator

        public static String FileSeparator()
        returns the file separator (e.g. "\" for Windows, "/" for Linux)
      • FolderListing

        public static String[] FolderListing​(String xDirectory)
        returns an array string containing the names of folders in the directory
      • GetLastModified

        public static String GetLastModified​(String xFile,
                                             String xDateFormat)
        returns the last date of modified
      • IsDirectory

        public static boolean IsDirectory​(String xPathname)
        check if a path represents a folder
      • IsFile

        public static boolean IsFile​(String xPathname)
        check if a path represents a file
      • Kill

        public static boolean Kill​(String xFilename)
        delete a file returns [true] = success, [false] = failed
      • MKDir

        public static boolean MKDir​(String xDirectoryname)
        create a directory returns [true] = success, [false] = failed
      • MKDirs

        public static boolean MKDirs​(String xDirectorynames)
        create a directory and subdirectories returns [true] = success, [false] = failed
      • Rename

        public static boolean Rename​(String xOldFilename,
                                     String xNewFilename)
        rename a file returns [true] = success, [false] = failed
      • RMDir

        public static boolean RMDir​(String xDirectoryname)
        remove a directory WARNING: all files in the directory will be deleted! returns [true] = success, [false] = failed
      • SetLastModified

        public static boolean SetLastModified​(String xFile,
                                              String xDateFormat,
                                              String xNewDateString)
        sets the date of modified returns [true] = success, [false] = failed
      • Size

        public static long Size​(String xFilename)
        returns the size of file in bytes