Package db2000.J.eXtrafunctions
Class fFILETOOLS
- java.lang.Object
-
- db2000.J.eXtrafunctions.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 booleanCopy(String xSourceFilename, String xDestinationFilename)copy a file returns [true] = success, [false] = failedstatic booleanCopyDirectory(String xDirSource, String xDirDestination)copy a directory returns [true] = success, [false] = failedstatic booleanExist(String xFilename)check if a file exists returns [true] = exist, [false] = not existstatic StringExtractPartFromFileName(String xFilename, int xPart)returns a portion of the file name xPart = 1 file name excluding extension, 2 = extension, 3 = filename, 4 = pathnamestatic String[]FileListing(String xDirectory)returns an array string containing the names of files and folders in the directorystatic String[]FileListing2(String xDirectory, String xExtention)returns an array string containing the names of files in the directorystatic StringFileSeparator()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 directorystatic StringGetLastModified(String xFile, String xDateFormat)returns the last date of modifiedstatic booleanIsDirectory(String xPathname)check if a path represents a folderstatic booleanIsFile(String xPathname)check if a path represents a filestatic booleanKill(String xFilename)delete a file returns [true] = success, [false] = failedstatic booleanMKDir(String xDirectoryname)create a directory returns [true] = success, [false] = failedstatic booleanMKDirs(String xDirectorynames)create a directory and subdirectories returns [true] = success, [false] = failedstatic booleanRename(String xOldFilename, String xNewFilename)rename a file returns [true] = success, [false] = failedstatic booleanRMDir(String xDirectoryname)remove a directory WARNING: all files in the directory will be deleted!static booleanSetLastModified(String xFile, String xDateFormat, String xNewDateString)sets the date of modified returns [true] = success, [false] = failedstatic longSize(String xFilename)returns the size of file in bytes
-
-
-
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 namexExtension- 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
-
-