Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.common.io.xfile
Class XFileDelete  view XFileDelete download XFileDelete.java

java.lang.Object
  extended bycom.flexstor.common.io.xfile.XFileAccessorFactory
      extended bycom.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.


Field Summary
 
Fields inherited from class com.flexstor.common.io.xfile.XFileAccessorFactory
BASE_PROTOCOL_PACKAGE, COPY, DELETE, fAccessor, MOVE, UNC_PROTOCOL, UNC_PROTOCOL_PACKAGE
 
Constructor Summary
XFileDelete()
           
 
Method Summary
 boolean deleteDirectory(java.lang.String sDir)
          Deletes the directory specified.
 boolean deleteDirectory(java.lang.String sDir, boolean bDeleteContent)
          Deletes the directory specified.
 boolean deleteFile(java.lang.String sFile)
          Deletes the file specified.
 boolean deleteFile(java.lang.String sFile, boolean bRemoveParentIfEmpty)
          Deletes the file specified.
 
Methods inherited from class com.flexstor.common.io.xfile.XFileAccessorFactory
disconnect, setCredentials, validateOperation, validateOperation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XFileDelete

public XFileDelete()
Method Detail

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.