|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--vc.util.FileSysUtility
FileSysUtility is a utility for doing the file related operations using the java infrastructure for handling the file system and its components.
Field Summary | |
static int |
DirectoriesOnly
A constant that flags that the current operation/state applies for directories only |
static int |
FilesAndDirectories
A constant that flags that the current operation/state applies for files both directories |
static int |
FilesOnly
A constant that flags that the current operation/state applies for files only |
Constructor Summary | |
FileSysUtility()
|
Method Summary | |
static java.io.File |
createDirectory(java.lang.String pathName,
boolean createIfDontExist)
Cretes a java.io.File object for a corresponding directory. |
static void |
getDirectoryChildren(java.io.File parentDirectory,
int childrenType,
java.util.Vector childrenVector)
Method for getting the subdirectories and/or files under the specified directory according to the children type wanted. |
static void |
getDirectoryChildren(java.lang.String parentDirectoryPath,
int childrenType,
java.util.Vector childrenVector)
Method for getting the subdirectories and/or files under the specified directory according to the children type wanted. |
static java.lang.String |
getFileContent(java.lang.String pathName)
Method for getting the content of a file whose path is passed as a parameter. |
static void |
saveFile(java.lang.String pathName,
java.lang.String fileContent)
Method for creating or recreating a file with the specified content. |
static java.util.Vector |
selectFiles(int fileSelectionMode,
java.awt.Component parent,
java.lang.String currentDirectoryPath)
Method for selecting the files and directories according to the options provided through the parameters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FilesOnly
public static final int DirectoriesOnly
public static final int FilesAndDirectories
Constructor Detail |
public FileSysUtility()
Method Detail |
public static java.util.Vector selectFiles(int fileSelectionMode, java.awt.Component parent, java.lang.String currentDirectoryPath) throws java.lang.Throwable
fileSelectionMode
- to specify to select only file or directories only or bothparent
- parent GUI component invoking this methodcurrentDirectoryPath
- initial directory to be shown in the GUI for
the selection of files/directoriespublic static java.lang.String getFileContent(java.lang.String pathName) throws java.lang.Throwable
pathName
- path of the file whose content is to be returnedpublic static void saveFile(java.lang.String pathName, java.lang.String fileContent) throws java.lang.Throwable
pathName
- path of the file which has to be created or recreated
with the content specified.fileContent
- content/data with which the file has to be created.public static void getDirectoryChildren(java.io.File parentDirectory, int childrenType, java.util.Vector childrenVector)
parentDirectory
- the directory whose children are to be returned.childrenType
- flag specifying if to return only file, or only
directories or both files and directories.childrenVector
- an out parameter to carry back the subdirectories
and/or files found under the directory.public static void getDirectoryChildren(java.lang.String parentDirectoryPath, int childrenType, java.util.Vector childrenVector)
parentDirectory
- path of the directory whose children are to be returned.childrenType
- flag specifying if to return only file, or only
directories or both files and directories.childrenVector
- an out parameter to carry back the subdirectories
and/or files found under the directory.public static java.io.File createDirectory(java.lang.String pathName, boolean createIfDontExist)
pathName
- path of the directory for which a corresponding
java.io.File object is to be created.createIfDontExist
- if true and directory doesnt exist then creates
a new directory with the path specified.Returns
- a java.io.File object corresponding to the directory.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |