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 boolean
Copy(String xSourceFilename, String xDestinationFilename)
copy a file returns [true] = success, [false] = failedstatic boolean
CopyDirectory(String xDirSource, String xDirDestination)
copy a directory returns [true] = success, [false] = failedstatic boolean
Exist(String xFilename)
check if a file exists returns [true] = exist, [false] = not existstatic String
ExtractPartFromFileName(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 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 directorystatic String
GetLastModified(String xFile, String xDateFormat)
returns the last date of modifiedstatic boolean
IsDirectory(String xPathname)
check if a path represents a folderstatic boolean
IsFile(String xPathname)
check if a path represents a filestatic boolean
Kill(String xFilename)
delete a file returns [true] = success, [false] = failedstatic boolean
MKDir(String xDirectoryname)
create a directory returns [true] = success, [false] = failedstatic boolean
MKDirs(String xDirectorynames)
create a directory and subdirectories returns [true] = success, [false] = failedstatic boolean
Rename(String xOldFilename, String xNewFilename)
rename a file returns [true] = success, [false] = failedstatic 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] = failedstatic long
Size(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
-
-