***  This API provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.webdav
Class DAVResource

java.lang.Object
  |
  +--com.sas.services.webdav.DAVResource
All Implemented Interfaces:
DAVResourceInterface,

public class DAVResource
extends Object
implements DAVResourceInterface

A DAVResource represents a WEBDAV (Distributed Authoring and Versioning) resource as specified in IETF RFC 2518. To create a DAVResource, use a ConnectionInfo object passed to the constructor. ConnectionInfo includes the url of the resource (containing the host, port and path), userid, password, proxy host, proxy port, proxy userid, proxy password. The DAVResource object can then be manipulated using the various methods defined in the Resource interface. After any operation on a resource, check the status on the object using getStatusCode() and getStatusMessage(). For example,

 try {
     ConnectionInfo c = new ConnectionInfo( "http://http-server/path-to-resource", "user", "pwd" );
     // proxy information, if required
     c.setProxyHost( "myproxy.com" );
     c.setProxyPort( 3100 );

     DAVResource r1 = new DAVResource( c, logger );
     r1.setProperty(...);
     if ( r1.getStatusCode() != 200 ) out.println( r1.getStatusMessage() );
 } catch (DAVException e) { e.printStackTrace(); }
 
In order to create a collection use the longer form of the constructor. For example,
 DAVResource r2 = new DAVResource( c, true, logger );
 
this will ensure that r2 is a collection resource (it may contain other resources). Alternatively do this in two steps
 DAVResource r2 = new DAVResource( c, logger );
 r2.makeCollection();
 


Field Summary
static int DONT_CARE
           
static int MUST_EXIST
           
static int MUST_NOT_EXIST
           
 
Constructor Summary
DAVResource(ConnectionInfo cInfo, boolean createCollection, LoggerInterface logger)
          Create a DAVResource using the connection information.
DAVResource(ConnectionInfo cInfo, LoggerInterface logger)
          Create a DAVResource using the connection information.
DAVResource(String url)
          Create a DAVResource using a string URL
DAVResource(String url, boolean createCollection)
          Create a DAVResource using a string URL and boolean flag to indicate whether a collection should be created or not
DAVResource(String url, boolean createCollection, String userName, String password)
          Create a DAVResource using a string URL.
DAVResource(String url, boolean createCollection, String userName, String password, LoggerInterface logger)
          Create a DAVResource using a string URL.
DAVResource(String url, LoggerInterface logger)
          Create a DAVResource using a string URL.
DAVResource(String url, String userName, String password)
          Create a DAVResource using a string URL, userName and password
DAVResource(String url, String userName, String password, LoggerInterface logger)
          Create a DAVResource using a string URL, userName and password.
DAVResource(URL url)
          Create a DAVResource using a Java URL
 
Method Summary
 void close()
          Close the connection used by this DAVResource
 DAVResource copy(String targetPath)
          Copy resource to the target path on the same host as the source
 void delete()
          Deletes the current resource
 void doCheckin()
          Check in this resource.
 void doCheckout()
          Checks out this resource.
 void doControl()
          Puts the resource until version control.
 void doLabel(int labelAction, String label)
          Modify the version label on the resource (if this is supported by the server).
 Properties doOptions()
           
 void doUncheckout()
          Uncheckout this resource, cancelling a previous checkout.
 boolean exists()
          Returns whether the resource exists or not
 String getACL()
          Get the Access Control List for this resource.
 org.apache.webdav.lib.Lock getActiveLockFor(String owner)
          Get an active lock, if it exists, for the owner
 String[] getAllowedMethods()
          Returns a list of methods allowed on this resource.
 Version getCheckedIn()
          Retrieves the currently checked in resource.
 Version getCheckedOut()
          Retrieves the currently checked out resource.
 byte[] getContents()
          Returns the contents of the resource as a byte array.
 void getContents(File fileData)
          Returns the contents of the resource into the supplied file
 String getContentsAsString()
          Return the contents of the resource as a String
 InputStream getContentsInputStream()
          Returns the contents of the resource as an InputStream
 String getContentType()
          Return the content type of the content for this resource
 String[] getDavCapabilities()
          Returns a list of DAV capabilties.
 int getDepth()
          Get the value for depth.
 int getExistsRequirement()
           
 LoggerInterface getLogger()
          Returns the logger currently being used by DAVResource.
 Map getMultiStatus()
          Return the multistatus information for the last operation.
 boolean getOverwrite()
          Get value for overWrite
 String getPath()
          Get the path for the WebDAV resource that is currently represented by this DAVResource
 List getPreviousVersionNames()
          Gets a list of previous version names for this resource.
 org.apache.webdav.lib.Property[] getProperties()
          Returns all the properties on the DAV resource
 org.apache.webdav.lib.Property[] getProperties(Element[] propNames)
          Returns all the properties specified in the parameter on the DAV resource
 org.apache.webdav.lib.Property[] getProperties(PropertyName[] propNames)
          Returns all the properties specified in the parameter on the DAV resource
 org.apache.webdav.lib.Property[] getProperties(String propNames)
          Returns properties for a given set of property names.
 org.apache.webdav.lib.Property[] getProperty(Element propName)
          Returns the property specified in the parameter on the DAV resource
 org.apache.webdav.lib.Property[] getProperty(PropertyName propName)
          Returns a property for a given property name.
 org.apache.webdav.lib.Property[] getProperty(String propName)
          Returns a property for a given property name.
 org.apache.webdav.lib.Property[] getPropertyNames()
          Returns a list of property names for the resource
 int getStatusCode()
          Returns the status code for the last operation
 String getStatusMessage()
          Returns the status message for the last operation.
 String getTempDir()
          Gets the current value of the directory used for temporary files.
 URL getURL()
          Returns the URL that this DAV Resource represents
 Version getVersion(String versionName)
          Gets a particular version of this resource
protected  boolean isAuthReqd()
          Returns whether a password is required to connect to this server
 boolean isCollection()
          Returns whether this resource is a collection or not
 boolean isLocked()
          Returns whether this resource is locked or not
 String lock()
          Locks the resource
 boolean makeCollection()
          Make a collection.
 DAVResource move(String targetPath)
          Move this resource to another location (path) on the same server as the source.
 void removeProperties(Element[] props)
          Remove/delete properties from a resource
 void removeProperties(PropertyName[] props)
          Remove/delete properties from a resource
 void removeProperty(Element prop)
          Remove/delete properties from a resource
 void removeProperty(PropertyName prop)
          Remove/delete a property from a resource
 void removeProperty(String prop)
          Remove/delete properties from a resource
 org.apache.webdav.lib.Property[] report(String body)
          Run a report on the current resource.
 org.apache.webdav.lib.Property[] search(Element searchQuery)
          The SEARCH method invokes one of the implemented search grammars on the server to evaluate the query.
 org.apache.webdav.lib.Property[] search(String searchString)
          The SEARCH method invokes one of the implemented search grammars on the server to evaluate the query.
 String setACL(String acl)
          Set/Update the Access Control List for this resource.
 void setContents(byte[] contents)
          Provide content for the resource.
 void setContents(InputStream is)
          Set the content from an InputStream.
 void setContents(String content)
          Set the contents of the resource, passing in a URL
 void setContents(URL url)
          Set the content for the resource from an URL
 void setContentType(String contentType)
          Set the contents type for the content of the resource
 void setDebug(int debug)
          Set the value for debug.
 void setDepth(int depth)
          Set the value for depth.
 void setExistsRequirement(int requirement)
           
 void setLogger(LoggerInterface logger)
          Set the logger to be used by DAVResource.
 void setOverwrite(boolean overwrite)
          Set the value for overWrite
 void setPassword(String password)
          Set the value for password.
 void setPath(String path)
          Set the path for this resource.
 void setPathNoAction(String path)
          Set the path for this resource.
 void setProperties(DocumentFragment doc)
          Set properties on the resource
 void setProperties(Element[] elems)
          Set properties on the resource
 void setProperties(PropertyName[] props, String[] propValues)
          Set properties on the resource
 void setProperty(Element elem)
          Set a property on the resource
 void setProperty(PropertyName prop, String propValue)
          Set a property on the resource
 void setSessionContext(SessionContextInterface sessionContext)
          Set the session context for this DAVResource.
 void setTempDir(String tempDir)
          Sets the temp directory used for storing files.
 void setUserName(String userName)
          Set the value for userName.
 boolean SUCCEEDED()
          Returns whether the last method was successful or not.
protected static boolean SUCCEEDED(int statusCode)
          Returns whether the statusCode parameter represents success or not.
 void unlock()
          Unlock a resource
 void unlock(String lockToken)
          Unlock a resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail


DONT_CARE

public static final int DONT_CARE

MUST_EXIST

public static final int MUST_EXIST

MUST_NOT_EXIST

public static final int MUST_NOT_EXIST
Constructor Detail

DAVResource

public DAVResource(String url)
            throws DAVException
Create a DAVResource using a string URL
Parameters:
url - URL for the resource

DAVResource

public DAVResource(String url,
                   LoggerInterface logger)
            throws DAVException
Create a DAVResource using a string URL. DAVResource will use the loggerinterface for logging.
Parameters:
url - URL for the resource
logger - LoggerInterface to be used for logging

DAVResource

public DAVResource(String url,
                   String userName,
                   String password)
            throws DAVException
Create a DAVResource using a string URL, userName and password
Parameters:
url - URL for the resource
userName - authentication user name
password - password for authentication

DAVResource

public DAVResource(String url,
                   String userName,
                   String password,
                   LoggerInterface logger)
            throws DAVException
Create a DAVResource using a string URL, userName and password. The specified logger will be used to log DAV activity.
Parameters:
url - URL for the resource
userName - authentication user name
password - password for authentication
logger - The logger to be used by DAVResource

DAVResource

public DAVResource(URL url)
            throws DAVException
Create a DAVResource using a Java URL
Parameters:
url - URL for the resource

DAVResource

public DAVResource(String url,
                   boolean createCollection)
            throws DAVException
Create a DAVResource using a string URL and boolean flag to indicate whether a collection should be created or not
Parameters:
url - URL for the resource
createCollection - The URL indicates a collection resource

DAVResource

public DAVResource(String url,
                   boolean createCollection,
                   String userName,
                   String password)
            throws DAVException
Create a DAVResource using a string URL. This constructor can also create a collection if createCollection is true
Parameters:
url - URL for the resource
createCollection - create a DAV collection if true
userName - authentication user name
password - password for authentication

DAVResource

public DAVResource(String url,
                   boolean createCollection,
                   String userName,
                   String password,
                   LoggerInterface logger)
            throws DAVException
Create a DAVResource using a string URL. This constructor can also create a collection if createCollection is true. The logger is used for DAVResource logging.
Parameters:
url - URL for the resource
createCollection - create a DAV collection if true
userName - authentication user name
password - password for authentication
logger - The logger to be used

DAVResource

public DAVResource(ConnectionInfo cInfo,
                   LoggerInterface logger)
            throws DAVException
Create a DAVResource using the connection information. The logger is used for DAVResource logging.
Parameters:
cInfo - The connection information for the resource
logger - The logger to be used

DAVResource

public DAVResource(ConnectionInfo cInfo,
                   boolean createCollection,
                   LoggerInterface logger)
            throws DAVException
Create a DAVResource using the connection information. The logger is used for DAVResource logging.
Parameters:
cInfo - The connection information for the resource
createCollection - create a DAV collection if true
logger - The logger to be used
Method Detail

makeCollection

public boolean makeCollection()
                       throws DAVException,
                              RemoteException
Make a collection. This method only works on a null resource (one that doesn't exist yet). One would normally call this method immediately after creating the DAVResource.
Specified by:
makeCollection in interface DAVResourceInterface
Following copied from interface: com.sas.services.webdav.DAVResourceInterface
Returns:
boolean True is make collection successful, false otherwise
Throws:
DAVException - in the case of a WebDAV error

copy

public DAVResource copy(String targetPath)
                 throws DAVException,
                        RemoteException
Copy resource to the target path on the same host as the source
Specified by:
copy in interface DAVResourceInterface
Parameters:
targetPath - The path to which current resource is to be copied.
Returns:
If successful, then a new DAVResource representing the new destination is created and returned

delete

public void delete()
            throws DAVException,
                   RemoteException
Deletes the current resource
Specified by:
delete in interface DAVResourceInterface
Following copied from interface: com.sas.services.webdav.DAVResourceInterface
Throws:
DAVException - in the event of a WebDAV failure.
RemoteException - in the event of network failure.

getActiveLockFor

public org.apache.webdav.lib.Lock getActiveLockFor(String owner)
                                            throws DAVException
Description copied from interface: DAVResourceInterface
Get an active lock, if it exists, for the owner
Specified by:
getActiveLockFor in interface DAVResourceInterface
Following copied from interface: com.sas.services.webdav.DAVResourceInterface
Parameters:
owner - The owner for which the lock is being sought
Returns:
Lock The lock for this owner if it exists
Throws:
DAVException - in the event of a WebDAV failure.
RemoteException - in the event of network failure.

getContents

public byte[] getContents()
                   throws DAVException,
                          RemoteException
Returns the contents of the resource as a byte array. This method assumes there is a limit on the length of the content and therefore uses memory to buffer the content. If the content is large or memory buffering is not desirable, then use the other getContentxxx methods for streaming content.
Specified by:
getContents in interface DAVResourceInterface
Returns:
byte[] The contents of the resource returned as a byte array
Throws:
DAVException - in the event of WebDAV errors
RemoteException - in the case of network errors

getContentsAsString

public String getContentsAsString()
                           throws DAVException,
                                  RemoteException
Return the contents of the resource as a String
Specified by:
getContentsAsString in interface DAVResourceInterface
Returns:
String The contents of the resource
Throws:
DAVException - in the event of a WebDAV failure.
RemoteException - in the event of network failure.

getContents

public void getContents(File fileData)
                 throws DAVException,
                        RemoteException
Returns the contents of the resource into the supplied file
Specified by:
getContents in interface DAVResourceInterface
Parameters:
fileData - The file to which the contents of the resource should be written
Throws:
DAVException - in the case of a WebDAV error
RemoteException - in the case of a network failure

getContentsInputStream

public InputStream getContentsInputStream()
                                   throws DAVException,
                                          RemoteException
Returns the contents of the resource as an InputStream
Specified by:
getContentsInputStream in interface DAVResourceInterface
Returns:
java.io.InputStream
Throws:
DAVException - in the case of a WebDAV error
RemoteException - in the case of a network failure

getContentType

public String getContentType()
                      throws DAVException,
                             RemoteException
Return the content type of the content for this resource
Specified by:
getContentType in interface DAVResourceInterface
Returns:
String The content type for this resource
Throws:
DAVException - in the event of a WebDAV failure.
RemoteException - in the event of network failure.

getProperties

public org.apache.webdav.lib.Property[] getProperties()
                                               throws DAVException,
                                                      RemoteException
Returns all the properties on the DAV resource
Specified by:
getProperties in interface DAVResourceInterface
Returns:
Array of DAV properties

getProperty

public org.apache.webdav.lib.Property[] getProperty(Element propName)
                                             throws DAVException,
                                                    RemoteException
Returns the property specified in the parameter on the DAV resource
Specified by:
getProperty in interface DAVResourceInterface
Parameters:
propName - property name elements - specifying which property value should be returned
Returns:
Array of DAV properties

getProperties

public org.apache.webdav.lib.Property[] getProperties(Element[] propNames)
                                               throws DAVException,
                                                      RemoteException
Returns all the properties specified in the parameter on the DAV resource
Specified by:
getProperties in interface DAVResourceInterface
Parameters:
propNames - Array of property name elements - specifying which property values should be returned
Returns:
Array of DAV properties

getProperty

public org.apache.webdav.lib.Property[] getProperty(PropertyName propName)
                                             throws DAVException,
                                                    RemoteException
Returns a property for a given property name. It is possible to return multiple property objects as the resouce might represent a collection.
Specified by:
getProperty in interface DAVResourceInterface
Parameters:
propName - name of property for which value should be returned
Returns:
Array of DAV properties

getProperties

public org.apache.webdav.lib.Property[] getProperties(PropertyName[] propNames)
                                               throws DAVException,
                                                      RemoteException
Returns all the properties specified in the parameter on the DAV resource
Specified by:
getProperties in interface DAVResourceInterface
Parameters:
propNames - Array of property names, specifying which property values should be returned
Returns:
Array of DAV properties

getProperty

public org.apache.webdav.lib.Property[] getProperty(String propName)
                                             throws DAVException,
                                                    RemoteException
Returns a property for a given property name. It is possible to return multiple property objects as the resouce might represent a collection.
Specified by:
getProperty in interface DAVResourceInterface
Parameters:
propName - name of property for which value should be returned
Returns:
Array of DAV properties

getProperties

public org.apache.webdav.lib.Property[] getProperties(String propNames)
                                               throws DAVException,
                                                      RemoteException
Returns properties for a given set of property names. Multiple properties from multiple resources might be returned as the resouce might represent a collection.
Specified by:
getProperties in interface DAVResourceInterface
Parameters:
propNames - names of properties for which values should be returned
Returns:
Array of DAV properties

getPropertyNames

public org.apache.webdav.lib.Property[] getPropertyNames()
                                                  throws DAVException,
                                                         RemoteException
Returns a list of property names for the resource
Specified by:
getPropertyNames in interface DAVResourceInterface
Returns:
Array of DAV properties

getStatusCode

public int getStatusCode()
                  throws DAVException,
                         RemoteException
Returns the status code for the last operation
Specified by:
getStatusCode in interface DAVResourceInterface
Returns:
status code for DAV Resource

getStatusMessage

public String getStatusMessage()
Returns the status message for the last operation. Text for statusCode.
Specified by:
getStatusMessage in interface DAVResourceInterface
Returns:
status message for DAV Resource

getURL

public URL getURL()
           throws DAVException,
                  RemoteException
Returns the URL that this DAV Resource represents
Specified by:
getURL in interface DAVResourceInterface
Returns:
url for resource

isCollection

public boolean isCollection()
Returns whether this resource is a collection or not
Specified by:
isCollection in interface DAVResourceInterface
Returns:
isCollection ?

isLocked

public boolean isLocked()
                 throws DAVException,
                        RemoteException
Returns whether this resource is locked or not
Specified by:
isLocked in interface DAVResourceInterface
Returns:
isLocked ?

lock

public String lock()
            throws DAVException,
                   RemoteException
Locks the resource
Specified by:
lock in interface DAVResourceInterface
Returns:
String The lock token for the successfully applied lock

move

public DAVResource move(String targetPath)
                 throws DAVException,
                        RemoteException
Move this resource to another location (path) on the same server as the source.
Specified by:
move in interface DAVResourceInterface
Parameters:
targetPath - The target path where the resource will be moved
Returns:
If successful, then a new DAVResource representing the new destination is created and returned

removeProperties

public void removeProperties(PropertyName[] props)
                      throws DAVException,
                             RemoteException
Remove/delete properties from a resource
Specified by:
removeProperties in interface DAVResourceInterface
Parameters:
props - names of the properties to remove

removeProperties

public void removeProperties(Element[] props)
                      throws DAVException,
                             RemoteException
Remove/delete properties from a resource
Specified by:
removeProperties in interface DAVResourceInterface
Parameters:
props - names of the properties to remove

removeProperty

public void removeProperty(Element prop)
                    throws DAVException,
                           RemoteException
Remove/delete properties from a resource
Specified by:
removeProperty in interface DAVResourceInterface
Parameters:
prop - property to remove

removeProperty

public void removeProperty(String prop)
                    throws DAVException,
                           RemoteException
Remove/delete properties from a resource
Specified by:
removeProperty in interface DAVResourceInterface
Parameters:
prop - property to remove

removeProperty

public void removeProperty(PropertyName prop)
                    throws DAVException,
                           RemoteException
Remove/delete a property from a resource
Specified by:
removeProperty in interface DAVResourceInterface
Parameters:
prop - name of the property to remove

search

public org.apache.webdav.lib.Property[] search(String searchString)
                                        throws DAVException,
                                               RemoteException
The SEARCH method invokes one of the implemented search grammars on the server to evaluate the query.

Specified by:
search in interface DAVResourceInterface
Parameters:
searchString - A string in the correct format for the grammar selected. This will be passed to the server in the body of the of the SEARCH method.
Returns:
Property[] An array of properties that satisfy the query

search

public org.apache.webdav.lib.Property[] search(Element searchQuery)
                                        throws DAVException,
                                               RemoteException
The SEARCH method invokes one of the implemented search grammars on the server to evaluate the query.

Specified by:
search in interface DAVResourceInterface
Parameters:
searchQuery - An XML representation of the query
Returns:
Property[] An array of properties that satisfy the query

setContents

public void setContents(byte[] contents)
                 throws DAVException,
                        RemoteException
Provide content for the resource. This will result in a PUT to the resource.
Specified by:
setContents in interface DAVResourceInterface
Parameters:
contents - byte array for the resource contents

setContents

public void setContents(URL url)
                 throws DAVException,
                        RemoteException
Set the content for the resource from an URL
Specified by:
setContents in interface DAVResourceInterface
Parameters:
url - The URL for the contents to be PUT to this resource

setContents

public void setContents(String content)
                 throws DAVException,
                        RemoteException
Set the contents of the resource, passing in a URL
Specified by:
setContents in interface DAVResourceInterface
Parameters:
content - The string containing the content for this resource
Throws:
DAVException - in the event of a WebDAV failure.
RemoteException - in the event of network failure.

setContents

public void setContents(InputStream is)
                 throws DAVException,
                        RemoteException
Set the content from an InputStream. As this information might be required more than once (eg. authorization required or a network error), the contents of the stream will be buffered in a temporary file, which will then be sent. For remote deployment the InputStream should be wrapped in an InputStreamAdapter
Specified by:
setContents in interface DAVResourceInterface
Parameters:
is - The input stream that contains the content.
Throws:
DAVException - in the case of a WebDAV error
RemoteException - in the case of a network failure

setContentType

public void setContentType(String contentType)
                    throws DAVException,
                           RemoteException
Set the contents type for the content of the resource
Specified by:
setContentType in interface DAVResourceInterface
Parameters:
contentType - The content type for this resource
Throws:
DAVException - in the event of a WebDAV failure.
RemoteException - in the event of network failure.

setProperties

public void setProperties(Element[] elems)
                   throws DAVException,
                          RemoteException
Set properties on the resource
Specified by:
setProperties in interface DAVResourceInterface
Parameters:
elems - an array of DOM2 elements that identify the properties to set on the resource

setProperties

public void setProperties(PropertyName[] props,
                          String[] propValues)
                   throws DAVException,
                          RemoteException
Set properties on the resource
Specified by:
setProperties in interface DAVResourceInterface
Parameters:
props - property names
propValues - property values (which will be escaped unless it is a CDATA section)

setProperties

public void setProperties(DocumentFragment doc)
                   throws DAVException,
                          RemoteException
Set properties on the resource
Specified by:
setProperties in interface DAVResourceInterface
Parameters:
doc - document fragment containing elements that represent the properties to be set on the resource

setProperty

public void setProperty(PropertyName prop,
                        String propValue)
                 throws DAVException,
                        RemoteException
Set a property on the resource
Specified by:
setProperty in interface DAVResourceInterface
Parameters:
prop - name of the property
propValue - value of the property (which will be escaped unless it is a CDATA section)

setProperty

public void setProperty(Element elem)
                 throws DAVException,
                        RemoteException
Set a property on the resource
Specified by:
setProperty in interface DAVResourceInterface
Parameters:
elem - an XML element that represents the property name and value

unlock

public void unlock()
            throws DAVException,
                   RemoteException
Unlock a resource
Specified by:
unlock in interface DAVResourceInterface
Following copied from interface: com.sas.services.webdav.DAVResourceInterface
Throws:
DAVException - in the event of a WebDAV failure.
RemoteException - in the event of network failure.

unlock

public void unlock(String lockToken)
            throws DAVException,
                   RemoteException
Unlock a resource
Specified by:
unlock in interface DAVResourceInterface
Following copied from interface: com.sas.services.webdav.DAVResourceInterface
Parameters:
lockToken - The lock token for this resource
Throws:
DAVException - in the event of a WebDAV failure.
RemoteException - in the event of network failure.

getOverwrite

public boolean getOverwrite()
Get value for overWrite
Specified by:
getOverwrite in interface DAVResourceInterface
Returns:
overWrite

setOverwrite

public void setOverwrite(boolean overwrite)
Set the value for overWrite
Specified by:
setOverwrite in interface DAVResourceInterface
Parameters:
overwrite -  

setUserName

public void setUserName(String userName)
Set the value for userName. Used in authentication requests to the server
Parameters:
userName - user name

setPassword

public void setPassword(String password)
Set the value for password. Used in authentication requests to the server
Parameters:
password - password

setDebug

public void setDebug(int debug)
Set the value for debug.
Parameters:
debug -  

setDepth

public void setDepth(int depth)
              throws DAVException,
                     RemoteException
Set the value for depth. This is the depth on which DAV operations will be based. They can be one of three values: DepthSupport is in org.apache.webdav.lib.methods
Specified by:
setDepth in interface DAVResourceInterface
Parameters:
depth - org.apache.webdav.lib.methods.DepthSupport

getDepth

public int getDepth()
Get the value for depth. This is the depth on which DAV operations will be based. They can be one of three values: DepthSupport is in org.apache.webdav.lib.methods
Specified by:
getDepth in interface DAVResourceInterface
Returns:
org.apache.webdav.lib.methods.DepthSupport

doOptions

public Properties doOptions()
                     throws DAVException,
                            RemoteException

getAllowedMethods

public String[] getAllowedMethods()
Returns a list of methods allowed on this resource.
Returns:
String[] - list of methods allowed on this resource

getDavCapabilities

public String[] getDavCapabilities()
Returns a list of DAV capabilties. The DAV header provides information on what DAV functions are supported by the server. Basic DAV support requires the DAV header and a value of "1", but support for locking features would have a value "1,2" for the DAV header. Further capabilities will be added in the future (eg. access-control). The DAV header is a comma delimited list of capabilites, returned as items in a string array.
Returns:
String[] - DAV capabilities supported by the server

isAuthReqd

protected boolean isAuthReqd()
Returns whether a password is required to connect to this server
Returns:
boolean - true if authentication credentials are required for a connnection, false otherwise

SUCCEEDED

public boolean SUCCEEDED()
Returns whether the last method was successful or not. The HTTP status codes in the range 200-299 are successful. All others indicate some sort of unsuccessful attempt.
Specified by:
SUCCEEDED in interface DAVResourceInterface
Returns:
boolean - true if last method was successful, false otherwise

SUCCEEDED

protected static boolean SUCCEEDED(int statusCode)
Returns whether the statusCode parameter represents success or not. The HTTP status codes in the range 200-299 are successful. All others indicate some sort of unsuccessful attempt.
Parameters:
statusCode - A status code to be checked for success or failure
Returns:
boolean - true if statusCode is successful, false otherwise

setLogger

public void setLogger(LoggerInterface logger)
Set the logger to be used by DAVResource. A default logger can be set on the constructor, but the logger can be changed using this method.
Parameters:
logger - The logger.

getLogger

public LoggerInterface getLogger()
Returns the logger currently being used by DAVResource.
Returns:
LoggerInterface The logger that is currently being used

getMultiStatus

public Map getMultiStatus()
Return the multistatus information for the last operation.
Returns:
Map (href to propstat) Multistatus response from the last DAV method.

close

public void close()
           throws RemoteException
Close the connection used by this DAVResource
Specified by:
close in interface DAVResourceInterface
Following copied from interface: com.sas.services.webdav.DAVResourceInterface
Throws:
RemoteException - in the event of network failure.

setTempDir

public void setTempDir(String tempDir)
                throws RemoteException
Sets the temp directory used for storing files. The default is set to the value of the Java system variable java.io.tmpdir, but if required can be changed for a particular instance using this method.
Specified by:
setTempDir in interface DAVResourceInterface
Parameters:
tempDir - The directory to be used for temporary files

getTempDir

public String getTempDir()
                  throws RemoteException
Gets the current value of the directory used for temporary files. The initial value of this field is taken from the Java system variable java.io.tmpdir, but may have been changed.
Specified by:
getTempDir in interface DAVResourceInterface
Returns:
String The directory used for temporary files

exists

public boolean exists()
               throws RemoteException
Returns whether the resource exists or not
Specified by:
exists in interface DAVResourceInterface
Returns:
boolean true if resource exists, false otherwise

report

public org.apache.webdav.lib.Property[] report(String body)
                                        throws DAVException,
                                               RemoteException
Run a report on the current resource. The report body is the body of the request sent to the server, using the REPORT method.
Specified by:
report in interface DAVResourceInterface
Parameters:
body - An XML document string that represents the report request
Returns:
Property[]. A list of the results from the report.
Throws:
DAVException - in the case of server failures
RemoteException - in the case of network failures

getACL

public String getACL()
              throws DAVException,
                     RemoteException
Get the Access Control List for this resource.
Specified by:
getACL in interface DAVResourceInterface
Returns:
String An XML serialized document describing the ACL for this resource
Throws:
DAVException - in the case of server failures
RemoteException - in the case of network failures

setACL

public String setACL(String acl)
              throws DAVException,
                     RemoteException
Set/Update the Access Control List for this resource.
Specified by:
setACL in interface DAVResourceInterface
Parameters:
acl - An XML serialized document describing the ACL for this resource
Returns:
Document The result document from the ACL method
Throws:
DAVException - in the case of server failures
RemoteException - in the case of network failures

setSessionContext

public void setSessionContext(SessionContextInterface sessionContext)
                       throws RemoteException
Description copied from interface: DAVResourceInterface
Set the session context for this DAVResource.
Specified by:
setSessionContext in interface DAVResourceInterface
Following copied from interface: com.sas.services.webdav.DAVResourceInterface
Parameters:
sessionContext - The session context for this DAVResource
Throws:
RemoteException - in the event of network failure.

setPath

public void setPath(String path)
Description copied from interface: DAVResourceInterface
Set the path for this resource. If the resource was originally created as http://server/origpath, then calling this method will change the resource path to http://server/path. This allows the same DAVResource object to be used for any WebDAV resource.
Specified by:
setPath in interface DAVResourceInterface
Following copied from interface: com.sas.services.webdav.DAVResourceInterface
Parameters:
path - The new path for the WebDAV resource
Throws:
RemoteException - in the event of a network failure

setPathNoAction

public void setPathNoAction(String path)
Deprecated.  

Description copied from interface: DAVResourceInterface
Set the path for this resource. If the resource was originally created as http://server/origpath, then calling this method will change the resource path to http://server/path. This allows the same DAVResource object to be used for any WebDAV resource.
Specified by:
setPathNoAction in interface DAVResourceInterface
Following copied from interface: com.sas.services.webdav.DAVResourceInterface
Parameters:
path - The new path for the WebDAV resource
Throws:
RemoteException - in the event of a network failure

getPath

public String getPath()
Description copied from interface: DAVResourceInterface
Get the path for the WebDAV resource that is currently represented by this DAVResource
Specified by:
getPath in interface DAVResourceInterface
Following copied from interface: com.sas.services.webdav.DAVResourceInterface
Returns:
String The current path for this WebDAV resource
Throws:
RemoteException - in the event of a network failure

doControl

public void doControl()
               throws DAVException,
                      RemoteException
Puts the resource until version control.
Specified by:
doControl in interface DAVResourceInterface
Throws:
DAVException - in the case of a WebDAV error
RemoteException - in the case of network failures

getPreviousVersionNames

public List getPreviousVersionNames()
                             throws DAVException,
                                    RemoteException
Gets a list of previous version names for this resource.
Specified by:
getPreviousVersionNames in interface DAVResourceInterface
Returns:
List(String) The version names for this resource
Throws:
DAVException - in the case of a WebDAV error
RemoteException - in the case of network failures

doCheckout

public void doCheckout()
                throws DAVException,
                       RemoteException
Checks out this resource.
Specified by:
doCheckout in interface DAVResourceInterface
Throws:
DAVException - in the case of a WebDAV error
RemoteException - in the case of network failures

doLabel

public void doLabel(int labelAction,
                    String label)
             throws DAVException,
                    RemoteException
Modify the version label on the resource (if this is supported by the server).
Specified by:
doLabel in interface DAVResourceInterface
Parameters:
labelAction - Specify whether the label should be set (specify 1), added (specify 2), removed (specify 3)
label - The value of the label
Throws:
DAVException - in the case of a WebDAV error
RemoteException - in the case of network failures

doCheckin

public void doCheckin()
               throws DAVException,
                      RemoteException
Check in this resource.
Specified by:
doCheckin in interface DAVResourceInterface
Throws:
DAVException - in the case of a WebDAV error
RemoteException - in the case of network failures

doUncheckout

public void doUncheckout()
                  throws DAVException,
                         RemoteException
Uncheckout this resource, cancelling a previous checkout.
Specified by:
doUncheckout in interface DAVResourceInterface
Throws:
DAVException - in the case of a WebDAV error
RemoteException - in the case of network failures

getCheckedIn

public Version getCheckedIn()
                     throws DAVException,
                            RemoteException
Retrieves the currently checked in resource.
Specified by:
getCheckedIn in interface DAVResourceInterface
Returns:
Version An object describing the version that is checked in
Throws:
DAVException - in the case of a WebDAV error
RemoteException - in the case of network failures

getCheckedOut

public Version getCheckedOut()
                      throws DAVException,
                             RemoteException
Retrieves the currently checked out resource.
Specified by:
getCheckedOut in interface DAVResourceInterface
Returns:
Version An object describing the version that is checked out
Throws:
DAVException - in the case of a WebDAV error
RemoteException - in the case of network failures

getVersion

public Version getVersion(String versionName)
                   throws DAVException,
                          RemoteException
Gets a particular version of this resource
Specified by:
getVersion in interface DAVResourceInterface
Parameters:
versionName - Which version to retrieve for this resource
Returns:
Version An object describing the version of this resource
Throws:
DAVException - in the case of a WebDAV error
RemoteException - in the case of network failures

setExistsRequirement

public void setExistsRequirement(int requirement)
Specified by:
setExistsRequirement in interface DAVResourceInterface

getExistsRequirement

public int getExistsRequirement()
Specified by:
getExistsRequirement in interface DAVResourceInterface

***  This API provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2006 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 17:29:04