java.lang.Object | |
↳ | com.microstrategy.utils.FileUtil |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FileUtil() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static void |
clear(String fileName)
Clears the contents of the file.
| ||||||||||
static void |
copy(String srcFileName, String desFileName)
Copies file srcFileName to another file desFileName.
| ||||||||||
static boolean |
deleteDir(File dir)
Deletes a directory (folder).
| ||||||||||
static String |
getFileExt(File f)
Returns file extension.
| ||||||||||
static boolean |
rename(String srcFileName, String desFileName)
Renames file srcFileName to desFileName.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Clears the contents of the file.
fileName | name of file to be cleared |
---|
FileNotFoundException | if file is not found |
---|---|
IOException | if there is a problem during the clear operation |
Copies file srcFileName to another file desFileName.
srcFileName | name of source file |
---|---|
desFileName | name of destination file |
FileNotFoundException | if srcFileName cannot be found |
---|---|
IOException | if there is a problem during the copy operation |
IllegalArgumentException | if either parameters are null |
Deletes a directory (folder). Since a directory can only be deleted if it's empty, it first deletes the contents of the directory recursively, then calls delete on the folder itself.
dir | Directory to delete |
---|
true
only if the folder and its content were deleted successfully.Returns file extension. Always in lower case. Returns null if not found. File with names that begin with "." are not considered an extension (null returned). PRE: assumes object is a file (not a directory).
Renames file srcFileName to desFileName.
srcFileName | name of source file |
---|---|
desFileName | new name |
true
if renaming was possible