java.lang.Object
com.flexstor.common.io.xfile.XFileAccessorFactory
com.flexstor.common.io.xfile.XFileDelete
- public class XFileDelete
- extends XFileAccessorFactory
XFileDelete has the capability to delete files and directories both local and remote.
Overloaded methods are provided to enable the deletion of a directory, if the file to delete is the
only one in that directory; and to recursively delete directories if a request to delete a directory
is requested.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XFileDelete
public XFileDelete()
deleteDirectory
public boolean deleteDirectory(java.lang.String sDir)
- Deletes the directory specified. This operation will delete any files and subdirectories within
the directory specified.
deleteDirectory
public boolean deleteDirectory(java.lang.String sDir,
boolean bDeleteContent)
- Deletes the directory specified. If the second argument is false, it will remove the directory
only if it is empty; if true, it will delete the directory and all of its content.
deleteFile
public boolean deleteFile(java.lang.String sFile)
- Deletes the file specified. If the file is the only one left, its directory will also be
removed.
deleteFile
public boolean deleteFile(java.lang.String sFile,
boolean bRemoveParentIfEmpty)
- Deletes the file specified. If the second argument is true, it will remove the directory if it
is empty; if false, it will not remove the directory even if it is empty.