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

Quick Search    Search Deep

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

java.lang.Object
  extended bycom.flexstor.common.io.xfile.XFileAccessorFactory
Direct Known Subclasses:
XFileCopy, XFileDelete, XFileMove

public class XFileAccessorFactory
extends java.lang.Object

XFileAccessor verifies that a file can be reached. It checks that the file protocol is valid and that credentials, if set, are also valid.


Field Summary
protected static java.lang.String BASE_PROTOCOL_PACKAGE
           
private  boolean bCredentialsSet
           
private  boolean bCredentialsValidated
           
protected static int COPY
           
protected static int DELETE
           
protected  XFileAccessorI fAccessor
           
protected static int MOVE
           
private  int nOperation
           
private  java.lang.String sPassword
           
private  java.lang.String sProtocol
           
private  java.lang.String sProtocolPackage
           
private  java.lang.String sUser
           
private  java.lang.String sValidatedHost
           
private  java.lang.String sValidatedPassword
           
private  java.lang.String sValidatedUser
           
protected static java.lang.String UNC_PROTOCOL
           
protected static java.lang.String UNC_PROTOCOL_PACKAGE
           
 
Constructor Summary
protected XFileAccessorFactory(int nOperation)
           
 
Method Summary
 void disconnect()
           
private  java.lang.String getOperation()
           
 void setCredentials(java.lang.String sUser, java.lang.String sPassword)
          Set the credentials for deleting a file.
private  void setInstance(java.lang.String sPath)
          Sets fAccessor to the proper instance of XFileDeleteI depending on the file protocol specified.
private  boolean validateCredentials(java.lang.String sPath)
          Validates the credentials against the remote server
protected  boolean validateOperation(java.lang.String sPath)
          This method validates the operation if the file protocol is valid and if the credentials set are valid.
protected  boolean validateOperation(java.lang.String sPath1, java.lang.String sPath2)
           
private  boolean validateProtocol(java.lang.String sPath)
          Validates the protocol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPY

protected static final int COPY
See Also:
Constant Field Values

DELETE

protected static final int DELETE
See Also:
Constant Field Values

MOVE

protected static final int MOVE
See Also:
Constant Field Values

UNC_PROTOCOL

protected static final java.lang.String UNC_PROTOCOL
See Also:
Constant Field Values

UNC_PROTOCOL_PACKAGE

protected static final java.lang.String UNC_PROTOCOL_PACKAGE
See Also:
Constant Field Values

BASE_PROTOCOL_PACKAGE

protected static final java.lang.String BASE_PROTOCOL_PACKAGE

sUser

private java.lang.String sUser

sPassword

private java.lang.String sPassword

sValidatedUser

private java.lang.String sValidatedUser

sValidatedPassword

private java.lang.String sValidatedPassword

sValidatedHost

private java.lang.String sValidatedHost

sProtocol

private java.lang.String sProtocol

sProtocolPackage

private java.lang.String sProtocolPackage

bCredentialsSet

private boolean bCredentialsSet

bCredentialsValidated

private boolean bCredentialsValidated

nOperation

private int nOperation

fAccessor

protected XFileAccessorI fAccessor
Constructor Detail

XFileAccessorFactory

protected XFileAccessorFactory(int nOperation)
Method Detail

setCredentials

public void setCredentials(java.lang.String sUser,
                           java.lang.String sPassword)
Set the credentials for deleting a file. Before deleting the file, this class attempts to validate the credentials with the file system. The credentials will be checked once, unless they are changed by invoking this method again.


disconnect

public void disconnect()

validateOperation

protected boolean validateOperation(java.lang.String sPath)
This method validates the operation if the file protocol is valid and if the credentials set are valid.


validateOperation

protected boolean validateOperation(java.lang.String sPath1,
                                    java.lang.String sPath2)

validateProtocol

private boolean validateProtocol(java.lang.String sPath)
Validates the protocol


validateCredentials

private boolean validateCredentials(java.lang.String sPath)
Validates the credentials against the remote server


setInstance

private void setInstance(java.lang.String sPath)
Sets fAccessor to the proper instance of XFileDeleteI depending on the file protocol specified.


getOperation

private java.lang.String getOperation()