org.apache.webdav.lib

Class WebdavResource


public class WebdavResource
extends WebdavSession

The class WebdavResource is an abstract representation for WebDAV resource.

 A functional comparison of WebdavResource and JDK(It's different a lot).
 ----------------------------------+-------------------------------------
   File class (JDK 1.3.x)          |  WebdavResource class
 ----------------------------------+-------------------------------------
   File(String)                    |  WebdavResource(HttpURL)
   File(String, String)            |  X (need to escape)
   File(File, String)              |  WebdavResource(HttpURL, String)
   getName()                       |  getName()
   getParent()                     |  *see getHttpURL() and HttpURL
   getParentFile()                 |  X (not yet)
   getPath()                       |  getPath()
   isAbsolute()                    |  X
   getAbsolutePath()               |
   getAbsoluteFile()               |  X
   getCanonicalPath()              |
   getCanonicalFile()              |  X
   toURL()                         |  *see HttpURL
   canRead()                       |
   !canWrite()                     |  !isLocked()
   exists()                        |  exists()
   isDirectory()                   |  isCollection()
   isFile()                        |  !isCollection()
   isHidden()                      |  getIsHidden()
   lastModified()                  |  getGetLastModified()
   length()                        |  getGetContentLength()
   createNewFile()                 |  putMethod(String)
   delete()                        |  deleteMethod()
   deleteOnExit()                  |  X
   list()                          |  list()
   list(FilenameFilter)            |  X
   listFiles()                     |  listWebdavResources()
   listFiles(FilenameFilter)       |  X
   listFiles(FileFilter)           |  X
   mkdir()                         |  mkcolMethod()
   mkdirs()                        |  mkcolMethod()
   renameTo(File)                  |  moveMethod(String)
   setLastModified()               |  X
   setReadOnly()                   |  setOverwrite(boolean)
   listRoots()                     |  *see WebdavSession
   generateFile()                  |
   createTempFile(...)             |  setGetTempDir(String)
   compareTo(Object)               |  compareTo(Object)
   equals(Object)                  |  equals(Object)
   hashCode()                      |  X
 ----------------------------------+-------------------------------------
   URL class (JDK 1.3.x)           |  Webdavresource and HttpURL classes
 ----------------------------------+-------------------------------------
   getQuery()                      |  getQuery()
   getPath()                       |  getPath()
   getUserInfo()                   |  getUserInfo()
   getAuthority()                  |  getAuthority()
   getPort()                       |  getPort()
   getProtocol()                   |  getScheme()
   getHost()                       |  getHost()
   getFile()                       |  getPath()
   getRef()                        |  getFragmenet()
   hashCode()                      |  X
   sameFile()                      |
   toExternalForm()                |  toExternalForm()
   openConnection()                |
   openStream()                    |
   getContent()                    |  getMethodDataAsString()
 ----------------------------------+-------------------------------------
   URLConnection class (JDK 1.3.x) |  HttpClient Library and more
 ----------------------------------+-------------------------------------
   getFileNameMap()                |  X
   setFileNameMap()                |  X
   connect()                       |
   getURL()                        |  HttpURL#getURL()
   getContenetLength()()           |
   getContentType()                |
   getContentEncoding()            |
   getExpiration()                 |
   getDate()                       |
   getLastModified()               |
   getHeaderField()                |
   getHeaderFieldInt()             |  X
   getHeaderFielDate()             |  X
   getHeaderFieldKey()             |  X
   getHeaderFiled(int)             |  X
   getContenet()                   |
   getInputStream()                |  WebdavResource#getMethodData()
   getOutputStream()               |  WebdavResource#putMethod(...)
   setDoInput()                    |  X
   getDoInput()                    |  X
   setAllowUserInteraction()       |  *see WebdavException and WebdavStatus
   getAllowUserInteraction()       |  *see WebdavException and WebdavStatus
   setUseCaches()                  |
   getUseCaches()                  |
   getIfModifiedSince()            |  X
   setIfModifiedSince(boolean)     |  X
   setRequestProperty(...)         |  X
   getRequestProperty(...)         |  X
   guessContentTypeFromStream(...) |  X
 ----------------------------------+-------------------------------------
 

Field Summary

static int
ALL
The action setting the all properties for this resource.
static int
BASIC
The action setting the basic properties for this resource.
static String
CREATIONDATE
The creationdate property.
static int
DEFAULT
The action setting the default DAV properties for this resource.
static String
DISPLAYNAME
The displayname property.
static String
FALSE
The false constant string.
static String
GETCONTENTLANGUAGE
The getcontentlanguage property.
static String
GETCONTENTLENGTH
The getcontentlength property.
static String
GETCONTENTTYPE
The getcontenttype property.
static String
GETETAG
The getetag property.
static String
GETLASTMODIFIED
The getlastmodifed property.
static String
ISCOLLECTION
The iscollection property.
static String
ISHIDDEN
The ishidden property.
static int
LABEL_ADD
static int
LABEL_REMOVE
static int
LABEL_SET
static String
LOCKDISCOVERY
The lockdiscovery property.
static int
NAME
The action setting only the displayname for this resource.
static int
NOACTION
No action to find properties for this resource.
static int
OPTIONS_VERSION_HISTORY
static int
OPTIONS_WORKSPACE
static String
RESOURCETYPE
The resourcetype property.
static String
SOURCE
The source property.
static String
SUPPORTEDLOCK
The supportedlock property.
static String
TRUE
The true constant string.
protected Enumeration
allowedMethods
The allowed HTTP methods.
protected WebdavResources
childResources
Table of the hrefs gotten in a collection.
protected long
creationDate
An WebDAV property, creationdate.
protected Enumeration
davCapabilities
The capabilities of the WebDAV server.
protected static int
defaultAction
The default action to find properties.
protected static int
defaultDepth
The default depth for WebDAV methods.
static String
defaultOwner
Owner information for locking and unlocking.
protected String
displayName
An WebDAV property, displayname.
protected boolean
exists
An WebdavResource flag to check its existence;
protected boolean
followRedirects
static SimpleDateFormat[]
formats
Date formats using for Date parsing.
protected long
getContentLength
An WebDAV property, getcontentlength.
protected String
getContentType
An WebDAV property, getcontenttype.
protected String
getEtag
An WebDAV property, getetag.
protected long
getLastModified
An WebDAV property, getlastmodified.
protected static TimeZone
gmtZone
GMT timezone.
protected HttpURL
httpURL
The HttpURL to represent a WebDAV resource.
protected boolean
isCollection
An WebDAV property, iscollection.
protected boolean
isHidden
An WebDAV property, ishidden.
protected int
latestStatusCode
An status code performed by HTTP methods at the most recent.
protected String
latestStatusMessage
An status message performed by HTTP methods at the most recent.
protected LockDiscoveryProperty
lockDiscovery
An WebDAV property, lockdiscovery.
protected boolean
overwrite
An WebdavResource flag to check overwriting;
protected String
owner
Owner information for locking and unlocking.
protected ResourceTypeProperty
resourceType
An WebDAV property, resourcetype.
protected String
supportedLock
An WebDAV property, supportedlock.
protected static String
tempDirForGet
Deprecated. The client is responsible for disk I/O.
protected boolean
thisResource
The flag to set the status code by propfind.
protected static boolean
useDiskForGet
Deprecated. The client is responsible for disk I/O.

Fields inherited from class org.apache.webdav.lib.WebdavSession

client, debug, hostCredentials, proxyCredentials, proxyHost, proxyPort

Constructor Summary

WebdavResource()
The default constructor.
WebdavResource(HttpClient client)
The constructor.
WebdavResource(HttpURL httpURL)
The constructor.
WebdavResource(HttpURL httpURL, Credentials credentials, int action, int depth)
The constructor.
WebdavResource(HttpURL httpURL, String additionalPath)
The constructor.
WebdavResource(HttpURL httpURL, String additionalPath, boolean followRedirects)
The constructor.
WebdavResource(HttpURL httpURL, String proxyHost, int proxyPort)
The constructor.
WebdavResource(HttpURL httpURL, String proxyHost, int proxyPort, Credentials proxyCredentials)
The constructor.
WebdavResource(HttpURL httpURL, String proxyHost, int proxyPort, Credentials proxyCredentials, boolean followRedirects)
WebdavResource(HttpURL httpURL, String proxyHost, int proxyPort, boolean followRedirects)
WebdavResource(HttpURL httpURL, boolean followRedirects)
The constructor.
WebdavResource(HttpURL httpURL, int depth)
The constructor.
WebdavResource(HttpURL httpURL, int depth, boolean followRedirects)
The constructor.
WebdavResource(HttpURL httpURL, int action, int depth)
The constructor.
WebdavResource(HttpURL httpURL, int action, int depth, boolean followRedirects)
The constructor.
WebdavResource(String escapedHttpURL)
The constructor.
WebdavResource(String escapedHttpURL, Credentials credentials)
The constructor.
WebdavResource(String escapedHttpURL, Credentials credentials, boolean followRedirects)
WebdavResource(String escapedHttpURL, String proxyHost, int proxyPort)
The constructor.
WebdavResource(String escapedHttpURL, String proxyHost, int proxyPort, Credentials proxyCredentials)
The constructor.
WebdavResource(String escapedHttpURL, boolean followRedirects)

Method Summary

boolean
abortTransaction()
Aborts - i.e.
boolean
aclMethod(String path, Ace[] aces)
Updates the resource with a new set of aces.
Enumeration
aclReportMethod(String path, Collection properties, int reportType)
Execute REPORT method.
AclProperty
aclfindMethod()
Return the AclProperty for the current resource
AclProperty
aclfindMethod(String path)
Return the AclProperty for the resource at the given path
boolean
bindMethod(String newBinding)
Execute the BIND method for this WebdavResource, given an existing path to bind with.
boolean
bindMethod(String existingBinding, String newBinding)
Execute the BIND method given the new path to bind to an existing path.
boolean
checkinMethod()
Execute the CHECKIN method for this WebdavResource.
boolean
checkinMethod(String path)
Execute the CHECKIN method for the given path.
boolean
checkoutMethod()
Execute the CHECKOUT method for this WebdavResource.
boolean
checkoutMethod(String path)
Execute the CHECKOUT method for the given path.
void
close()
Close the session of this client
boolean
commitTransaction()
Commits the transaction started by startTransaction(String,int) and resets the transaction handle.
int
compareTo(Object another)
Compare to the given another object.
int
compareToWebdavResource(WebdavResource another)
Compare to the WebdavResource object.
boolean
copyMethod(String destination)
Execute the COPY method for the given destination path.
boolean
copyMethod(String source, String destination)
Execute the COPY method the given source and destination.
protected WebdavResource
createWebdavResource(HttpClient client)
Create a new WebdavResource object (as a seperate method so that it can be overridden by subclasses.
boolean
deleteMethod()
Execute the DELETE method for this WebdavResource.
boolean
deleteMethod(String path)
Execute the DELETE method for the given path.
protected WebdavState
discoverLock(String owner, String path, WebdavState state)
Discover the given owner and locktoken and set the locktoken
void
discoverOwnLocks()
Discover and refresh lock tokens.
void
discoverOwnLocks(String owner)
Discover and refresh lock tokens for a specific owner.
protected boolean
endTransaction(String path, int transactionStatus)
boolean
equals(Object obj)
Test the object.
int
executeHttpRequestMethod(HttpClient client, HttpMethod method)
Execute the http request method.
boolean
exists()
Returns the last known information about the existence of this resource.
protected void
generateIfHeader(HttpMethod method)
Generate and add the If header to the specified HTTP method.
protected void
generateTransactionHeader(HttpMethod method)
Generates and adds the "Transaction" header if this method is part of an externally controlled transaction.
Enumeration
getActiveLockOwners()
Get the activelock owners for this resource.
Enumeration
getAllowedMethods()
Get the allowed methods, checked by HTTP OPTIONS.
WebdavResources
getChildResources()
Get all resources in this collection with the depth 1.
long
getCreationDate()
Get the value of DAV property, creationdate.
Enumeration
getDavCapabilities()
Get the WebDAV capabilities, checked by HTTP OPTIONS.
static int
getDefaultAction()
Get the default action.
static int
getDefaultDepth()
Get the default action.
String
getDisplayName()
Get the value of DAV property, displayname.
boolean
getExistence()
Returns the last known information about the existence of this resource.
boolean
getFollowRedirects()
Returns the current "follow redirects" flag.
long
getGetContentLength()
Get the value of DAV property, getcontentlength.
String
getGetContentType()
Get the value of DAV property, getcontenttype.
String
getGetEtag()
Get the value of DAV property, getetag.
long
getGetLastModified()
Get the value of DAV property, getlastmodified.
static String
getGetTempDir()
Deprecated. The returned directory is not used by the GET method.
static boolean
getGetUseDisk()
Deprecated. This method always returns false.
String
getHost()
Get the hostname of this WebdavResource.
HttpURL
getHttpURL()
Get the HttpURL of this WebdavResource.
HttpURL
getHttpURLExceptForUserInfo()
Get the HttpURL except for userinfo.
boolean
getIsCollection()
Get the value of DAV property, iscollection
boolean
getIsHidden()
Get the value of DAV property, ishidden.
LockDiscoveryProperty
getLockDiscovery()
Get the value of DAV property, lockdiscovery.
boolean
getMethod(File file)
Execute the GET method for this WebdavResource path.
boolean
getMethod(String path, File file)
Execute the GET method for the given path.
InputStream
getMethodData()
Get InputStream for the GET method.
InputStream
getMethodData(String path)
Get InputStream for the GET method for the given path.
String
getMethodDataAsString()
Get data as a String for the GET method.
String
getMethodDataAsString(String path)
Get data as a String for the GET method for the given path.
String
getName()
Get the name of this WebdavResource.
boolean
getOverwrite()
Get the current value of the overwrite flag for COPY, MOVE, BIND and REBIND.
String
getOwner()
Get the owner string, as used for locking purposes.
String
getPath()
Get the path part of this WebdavResource.
ResourceTypeProperty
getResourceType()
Get the value of DAV property, resourcetype.
int
getStatusCode()
Get the lastest value of the status code by HTTP methods.
String
getStatusMessage()
Get the lastest value of the status message by HTTP methods.
String
getSupportedLock()
Get the value of DAV property, supportedlock.
String
getTransactionHandle()
Returns the transaction handle set by startTransaction(String,int).
boolean
headMethod()
Execute the HEAD method for this WebdavResource.
boolean
headMethod(String path)
Execute the HEAD method for the given path.
boolean
isCollection()
Get the value of DAV property, resourcetype
boolean
isLocked()
Test that this resource is locked.
protected boolean
isTheClient()
Test that the httpURL is the same with the client.
boolean
labelMethod(String path, String labelname, int type)
Execute a LABEL method on the given path, setting the given label
boolean
labelMethod(String labelname, int type)
Execute a LABEL method on the current path, setting the given label
String[]
list()
Get an array of pathnames denoting the WebDAV resources in the collection denoted by this pathname.
Vector
listBasic()
Get an array of pathnames and basic information denoting the WebDAV resources in the denoted by this pathname.
WebdavResource[]
listWebdavResources()
Get an array of resources denoting the WebDAV child resources in the collection of this resources.
LockDiscoveryProperty
lockDiscoveryPropertyFindMethod()
Return the LockDiscoveryProperty for the current resource
LockDiscoveryProperty
lockDiscoveryPropertyFindMethod(String path)
Return the LockDiscoveryProperty for the resource at the given path
boolean
lockMethod()
Execute the LOCK method for this WebdavResource.
boolean
lockMethod(String path)
Execute the LOCK method for the given path.
boolean
lockMethod(String path, String owner, int timeout)
Execute the LOCK method for the given path.
boolean
lockMethod(String path, String owner, int timeout, short lockType)
Execute the LOCK method for the given path.
boolean
lockMethod(String path, String owner, int timeout, short lockType, int depth)
Execute the LOCK method for the given path.
boolean
lockMethod(String path, String owner, short timeout)
Deprecated. The timeout value MUST NOT be greater than 2^32-1.
boolean
lockMethod(String owner, int timeout)
Execute the LOCK method for this WebdavResource.
boolean
lockMethod(String owner, short timeout)
Deprecated. The timeout value MUST NOT be greater than 2^32-1.
boolean
mkWorkspaceMethod()
Execute the MKWORKSPACE method for this WebdavResource.
boolean
mkWorkspaceMethod(String path)
Execute the MKCOL method for the given path.
boolean
mkcolMethod()
Execute the MKCOL method for this WebdavResource.
boolean
mkcolMethod(String path)
Execute the MKCOL method for the given path.
boolean
moveMethod(String destination)
Execute the MOVE method for this WebdavReource.
boolean
moveMethod(String source, String destination)
Execute the MOVE method for the given source and destination.
boolean
optionsMethod()
Execute OPTIONS method for this WebdavResource.
Enumeration
optionsMethod(HttpURL httpURL)
Execute OPTIONS method for the given http URL.
Enumeration
optionsMethod(HttpURL httpURL, int type)
Execute OPTIONS method for the given http URL, DELTAV
boolean
optionsMethod(String path)
Execute OPTIONS method for the given path.
boolean
optionsMethod(String path, String aMethod)
Execute OPTIONS method for the given path.
Enumeration
optionsMethod(String path, int type)
Execute OPTIONS method for the given path.
protected Date
parseDate(String dateValue)
Parse the java.util.Date string for HTTP-date.
boolean
pollMethod(String contentLocation, int subscriptionId)
Asks the server whether events for a given subscription are fired.
boolean
pollMethod(Subscription subscription)
Asks the server whether events for a given subscription are fired.
PrincipalCollectionSetProperty
principalCollectionSetFindMethod()
Get the PrincipalCollectionSetProperty for the current resource.
PrincipalCollectionSetProperty
principalCollectionSetFindMethod(String path)
Get the PrincipalCollectionSetProperty for the resource.
protected void
processProperty(Property property)
Process a property, setting various member variables depending on what the property is.
Enumeration
propfindMethod(String propertyName)
Execute PROPFIND method for this WebdavResource.
Enumeration
propfindMethod(String path, String propertyName)
Execute PROPFIND method for the given WebdavResource path.
Enumeration
propfindMethod(String path, Vector properties)
Execute PROPFIND method for the given path and properties.
Enumeration
propfindMethod(String path, int depth)
Execute PROPFIND method with allprop for the given path.
Enumeration
propfindMethod(String path, int depth, Vector properties)
Execute PROPFIND method with by propname for the given path.
Enumeration
propfindMethod(Vector properties)
Execute PROPFIND method for this WebdavResource.
Enumeration
propfindMethod(int depth)
Execute PROPFIND method with allprop for this WebdavResource.
Enumeration
propfindMethod(int depth, Vector properties)
Execute PROPFIND method with by propname for this resource.
boolean
proppatchMethod(Hashtable properties)
Deprecated. it could be removed after the major version changes
boolean
proppatchMethod(Hashtable properties, boolean action)
Execute PROPATCH method for this resource with the given properties.
boolean
proppatchMethod(String path, Hashtable properties)
Deprecated. it could be removed after the major version changes
boolean
proppatchMethod(String path, Hashtable properties, boolean action)
Execute PROPATCH method for the specified resource with the given properties.
boolean
proppatchMethod(String propertyName, String propertyValue)
Deprecated. it could be removed after the major version changes
boolean
proppatchMethod(String path, String propertyName, String propertyValue)
Deprecated. it could be removed after the major version changes
boolean
proppatchMethod(String path, String propertyName, String propertyValue, boolean action)
Execute PROPATCH method for the specified resource with the given property.
boolean
proppatchMethod(String propertyName, String propertyValue, boolean action)
Execute PROPATCH method for this resource with the given property.
boolean
proppatchMethod(String path, PropertyName propertyName, String propertyValue)
Deprecated. it could be removed after the major version changes
boolean
proppatchMethod(String path, PropertyName propertyName, String propertyValue, boolean action)
Execute PROPATCH method for the given resource with the given properties.
boolean
proppatchMethod(PropertyName propertyName, String propertyValue)
Deprecated. it could be removed after the major version changes
boolean
proppatchMethod(PropertyName propertyName, String propertyValue, boolean action)
Execute PROPATCH method for this resource with the given property.
boolean
putMethod(File file)
Execute the PUT method for this WebdavResource.
boolean
putMethod(InputStream is)
Execute the PUT method for this resource.
boolean
putMethod(String data)
Execute the PUT method for this WebdavResource.
boolean
putMethod(String path, File file)
Execute the PUT method for the given path.
boolean
putMethod(String path, InputStream is)
Execute the PUT method for the given path.
boolean
putMethod(String path, String data)
Execute the PUT method for the given path.
boolean
putMethod(String path, URL url)
Execute the PUT method for the given path from the given url.
boolean
putMethod(String path, byte[] data)
Execute the PUT method for the given path.
boolean
putMethod(URL url)
Execute the PUT method for this resource from the given url.
boolean
putMethod(byte[] data)
Execute the PUT method for this resource.
boolean
rebindMethod(String newBinding)
Execute the Rebind method for this WebdavResource given the new Resource to bind with.
boolean
rebindMethod(String existingBinding, String newBinding)
Execute the Rebind method given a resource to rebind and the new Resource to bind with.
protected void
refresh()
Refresh the properties of this resource without changing the status of the previous command
Enumeration
reportMethod(HttpURL httpURL, String sQuery, int depth)
Enumeration
reportMethod(HttpURL httpURL, Vector properties)
Enumeration
reportMethod(HttpURL httpURL, Vector properties, Vector histUri, int depth)
Enumeration
reportMethod(HttpURL httpURL, Vector properties, int depth)
Enumeration
reportMethod(HttpURL httpURL, int depth)
Execute the REPORT method.
HttpClient
retrieveSessionInstance()
Retrieve the current http client for this resource.
protected void
setAllProp(int depth)
Set all properties for this resource.
protected void
setBasicProperties(int depth)
Sets the basic properties on a resource by indirectly issuing a PROPFIND on the resource.
protected void
setClient()
Set the client for this resource.
protected void
setClient(HttpURL httpURL)
Set the client for this resource and the given http URL.
void
setContentType(String contentType)
Set the content-type to use for this resource, for PUTs.
protected void
setCreationDate(String creationDate)
Set the value of DAV property, creationdate.
protected void
setCreationDate(long creationDate)
Set the value of DAV property, creationdate.
static void
setDefaultAction(int action)
Set the default action for this resource.
static void
setDefaultDepth(int depth)
Set the default action for this resource.
protected void
setDefaultProperties(int depth)
Set the default properties on the resource by indirectly issuing a PROPFIND request for a default set of properties.
protected void
setDisplayName(String displayName)
Set the value of DAV property, displayname.
void
setEncodeURLs(boolean encodeURLs)
Deprecated. No longer has any effect.
protected void
setExistence(boolean exists)
Set its existence.
void
setFollowRedirects(boolean value)
Sets a flag indicating that redirect responses from the server shall be followed.
protected void
setGetContentLength(String getContentLength)
Set the value of DAV property, getcontentlength.
protected void
setGetContentLength(long getContentLength)
Set the value of DAV property, getcontentlength.
protected void
setGetContentType(String getContentType)
Set the value of DAV property, getcontenttype.
protected void
setGetEtag(String getEtag)
Set the value of DAV property, getetag.
protected void
setGetLastModified(String getLastModified)
Set the value of DAV property, getlastmodified.
protected void
setGetLastModified(long getLastModified)
Set the value of DAV property, getlastmodified.
static void
setGetTempDir(String tempDir)
Deprecated. The given directory will not be used.
static void
setGetUseDisk(boolean useDisk)
Deprecated. This method has no effect.
void
setHttpURL(HttpURL httpURL)
Set the HttpURL for this WebdavResource.
void
setHttpURL(HttpURL httpURL, String additionalPath)
Set the HttpURL for this WebdavResource.
void
setHttpURL(HttpURL httpURL, String additionalPath, int action)
Set the HttpURL for this WebdavResource.
void
setHttpURL(HttpURL httpURL, String additionalPath, int action, int depth)
Set the HttpURL for this WebdavResource.
void
setHttpURL(HttpURL httpURL, int depth)
Set the HttpURL for this WebdavResource.
void
setHttpURL(HttpURL httpURL, int action, int depth)
Set the HttpURL for this WebdavResource.
void
setHttpURL(String escapedHttpURL)
Set the HttpURL of this WebdavResource.
protected void
setIsCollection(String isCollection)
Set the value of DAV property, iscollection
protected void
setIsCollection(boolean isCollection)
Set the value of DAV property, iscollection
protected void
setIsHidden(String isHidden)
Set the value of DAV property, ishidden.
protected void
setIsHidden(boolean isHidden)
Set the value of DAV property, ishidden.
protected void
setLockDiscovery(LockDiscoveryProperty lockDiscovery)
Set the value of DAV property, lockdiscovery.
protected void
setNameProperties(int depth)
Set only the displayname property for this resource.
protected void
setNamedProp(int depth, Vector propertyNames)
Set the named properties for this resource.
void
setOverwrite(boolean overwrite)
Set the overwrite flag for COPY, MOVE, BIND and REBIND.
void
setPath(String path)
Set the path part of this WebdavResource.
void
setProperties(int depth)
Set the properties for this resource.
void
setProperties(int action, int depth)
Set the properties for this resource.
protected void
setResourceType(ResourceTypeProperty resourceType)
Set the value of DAV property, resourcetype.
protected void
setStatusCode(int statusCode)
Set the lastest value of the status code by HTTP methods.
protected void
setStatusCode(int statusCode, String message)
Set the lastest value of the status code by HTTP methods.
protected void
setSupportedLock(String supportedLock)
Set the value of DAV property, supportedlock.
void
setUserInfo(String userName, String password)
Set the userinfo part of this WebdavResource.
protected void
setWebdavProperties(Enumeration responses)
Set WebDAV properties following to the given http URL.
boolean
startTransaction(String owner, int timeout)
Begins a new transaction.
Subscription
subscribeMethod(String path, String notificationType, String callback, long notificationDelay, int depth, long lifetime)
Subscribes for notifications for modifications of WebDAV resources.
boolean
subscribeMethod(String path, int subscriptionId)
Refreshes a subscription.
boolean
subscribeMethod(Subscription subscription)
Refreshes a subscription.
String
toString()
Return the http URL string.
boolean
unbindMethod()
Execute the UNBIND method for this WebdavResource.
boolean
unbindMethod(String binding)
Execute the UNBIND method given the resource to Unbind.
boolean
uncheckoutMethod()
Execute the CHECKOUT method for this WebdavResource.
boolean
uncheckoutMethod(String path)
Execute the CHECKOUT method for the given path.
boolean
unlockMethod()
Execute the Unlock method for this WebdavResource.
boolean
unlockMethod(String path)
Execute the Unlock method for the given path.
boolean
unlockMethod(String path, String owner)
Execute the Unlock method for the given path.
boolean
unsubscribeMethod(String path, int subscriptionId)
Cancels a subscription.
boolean
unsubscribeMethod(Subscription subscription)
Cancels a subscription.
boolean
updateMethod(String target)
Update this resource to the specified target
boolean
updateMethod(String path, String target)
Update the specified resource to the specified target
boolean
versionControlMethod(String path)
boolean
versionControlMethod(String path, String target)

Methods inherited from class org.apache.webdav.lib.WebdavSession

closeSession, closeSession, getSessionInstance, getSessionInstance, setCredentials, setDebug, setProxy, setProxyCredentials

Field Details

ALL

public static final int ALL
The action setting the all properties for this resource.
Field Value:
5

BASIC

public static final int BASIC
The action setting the basic properties for this resource.
Field Value:
3

CREATIONDATE

public static final String CREATIONDATE
The creationdate property.

DEFAULT

public static final int DEFAULT
The action setting the default DAV properties for this resource.
Field Value:
4

DISPLAYNAME

public static final String DISPLAYNAME
The displayname property.

FALSE

public static final String FALSE
The false constant string.

GETCONTENTLANGUAGE

public static final String GETCONTENTLANGUAGE
The getcontentlanguage property.

GETCONTENTLENGTH

public static final String GETCONTENTLENGTH
The getcontentlength property.

GETCONTENTTYPE

public static final String GETCONTENTTYPE
The getcontenttype property.

GETETAG

public static final String GETETAG
The getetag property.

GETLASTMODIFIED

public static final String GETLASTMODIFIED
The getlastmodifed property.

ISCOLLECTION

public static final String ISCOLLECTION
The iscollection property.

ISHIDDEN

public static final String ISHIDDEN
The ishidden property.

LABEL_ADD

public static final int LABEL_ADD
Field Value:
12

LABEL_REMOVE

public static final int LABEL_REMOVE
Field Value:
11

LABEL_SET

public static final int LABEL_SET
Field Value:
10

LOCKDISCOVERY

public static final String LOCKDISCOVERY
The lockdiscovery property.

NAME

public static final int NAME
The action setting only the displayname for this resource.
Field Value:
2

NOACTION

public static final int NOACTION
No action to find properties for this resource.
Field Value:
1

OPTIONS_VERSION_HISTORY

public static final int OPTIONS_VERSION_HISTORY
Field Value:
9

OPTIONS_WORKSPACE

public static final int OPTIONS_WORKSPACE
Field Value:
8

RESOURCETYPE

public static final String RESOURCETYPE
The resourcetype property.

SOURCE

public static final String SOURCE
The source property.

SUPPORTEDLOCK

public static final String SUPPORTEDLOCK
The supportedlock property.

TRUE

public static final String TRUE
The true constant string.

allowedMethods

protected Enumeration allowedMethods
The allowed HTTP methods.

childResources

protected WebdavResources childResources
Table of the hrefs gotten in a collection.

creationDate

protected long creationDate
An WebDAV property, creationdate.

davCapabilities

protected Enumeration davCapabilities
The capabilities of the WebDAV server.

defaultAction

protected static int defaultAction
The default action to find properties.

defaultDepth

protected static int defaultDepth
The default depth for WebDAV methods.

defaultOwner

public static final String defaultOwner
Owner information for locking and unlocking.

displayName

protected String displayName
An WebDAV property, displayname.

exists

protected boolean exists
An WebdavResource flag to check its existence;

followRedirects

protected boolean followRedirects

formats

public static final SimpleDateFormat[] formats
Date formats using for Date parsing.

getContentLength

protected long getContentLength
An WebDAV property, getcontentlength.

getContentType

protected String getContentType
An WebDAV property, getcontenttype.

getEtag

protected String getEtag
An WebDAV property, getetag.

getLastModified

protected long getLastModified
An WebDAV property, getlastmodified.

gmtZone

protected static final TimeZone gmtZone
GMT timezone.

httpURL

protected HttpURL httpURL
The HttpURL to represent a WebDAV resource.

isCollection

protected boolean isCollection
An WebDAV property, iscollection.

isHidden

protected boolean isHidden
An WebDAV property, ishidden.

latestStatusCode

protected int latestStatusCode
An status code performed by HTTP methods at the most recent.

latestStatusMessage

protected String latestStatusMessage
An status message performed by HTTP methods at the most recent.

lockDiscovery

protected LockDiscoveryProperty lockDiscovery
An WebDAV property, lockdiscovery.

overwrite

protected boolean overwrite
An WebdavResource flag to check overwriting;

owner

protected String owner
Owner information for locking and unlocking.

resourceType

protected ResourceTypeProperty resourceType
An WebDAV property, resourcetype.

supportedLock

protected String supportedLock
An WebDAV property, supportedlock.

tempDirForGet

protected static String tempDirForGet

Deprecated. The client is responsible for disk I/O.

The default temporary directory for the GET method.

thisResource

protected boolean thisResource
The flag to set the status code by propfind.

useDiskForGet

protected static boolean useDiskForGet

Deprecated. The client is responsible for disk I/O.

The flag setter to use the disk for the GET method.

Constructor Details

WebdavResource

protected WebdavResource()
The default constructor.

WebdavResource

protected WebdavResource(HttpClient client)
The constructor.

WebdavResource

public WebdavResource(HttpURL httpURL)
            throws HttpException,
                   IOException
The constructor.
Parameters:
httpURL - The specified http URL.

WebdavResource

public WebdavResource(HttpURL httpURL,
                      Credentials credentials,
                      int action,
                      int depth)
            throws HttpException,
                   IOException
The constructor.
Parameters:
httpURL - The specified http URL.
credentials - The credentials to use for authentication.
action - The action to set properties of this resource.
depth - The depth to find properties.

WebdavResource

public WebdavResource(HttpURL httpURL,
                      String additionalPath)
            throws HttpException,
                   IOException
The constructor.
Parameters:
httpURL - The http URL.
additionalPath - The added relative path.

WebdavResource

public WebdavResource(HttpURL httpURL,
                      String additionalPath,
                      boolean followRedirects)
            throws HttpException,
                   IOException
The constructor.
Parameters:
httpURL - The http URL.
additionalPath - The added relative path.
followRedirects - shall redirects be accepted

WebdavResource

public WebdavResource(HttpURL httpURL,
                      String proxyHost,
                      int proxyPort)
            throws HttpException,
                   IOException
The constructor.
Parameters:
httpURL - The specified http URL.
proxyHost - The hostname of the proxy to use.
proxyPort - The port number of the proxy to use.

WebdavResource

public WebdavResource(HttpURL httpURL,
                      String proxyHost,
                      int proxyPort,
                      Credentials proxyCredentials)
            throws HttpException,
                   IOException
The constructor.
Parameters:
httpURL - The specified http URL.
proxyHost - The hostname of the proxy to use.
proxyPort - The port number of the proxy to use.
proxyCredentials - Credentials to use for proxy authentication.

WebdavResource

public WebdavResource(HttpURL httpURL,
                      String proxyHost,
                      int proxyPort,
                      Credentials proxyCredentials,
                      boolean followRedirects)
            throws HttpException,
                   IOException

WebdavResource

public WebdavResource(HttpURL httpURL,
                      String proxyHost,
                      int proxyPort,
                      boolean followRedirects)
            throws HttpException,
                   IOException

WebdavResource

public WebdavResource(HttpURL httpURL,
                      boolean followRedirects)
            throws HttpException,
                   IOException
The constructor.
Parameters:
httpURL - The specified http URL.
followRedirects - shall redirects from the server be accepted

WebdavResource

public WebdavResource(HttpURL httpURL,
                      int depth)
            throws HttpException,
                   IOException
The constructor.
Parameters:
httpURL - The specified http URL.
depth - The depth to find properties.

WebdavResource

public WebdavResource(HttpURL httpURL,
                      int depth,
                      boolean followRedirects)
            throws HttpException,
                   IOException
The constructor.
Parameters:
httpURL - The specified http URL.
depth - The depth to find properties.
followRedirects - Shall redirects be followed automatically.

WebdavResource

public WebdavResource(HttpURL httpURL,
                      int action,
                      int depth)
            throws HttpException,
                   IOException
The constructor.
Parameters:
httpURL - The specified http URL.
action - The action to set properties of this resource.
depth - The depth to find properties.

WebdavResource

public WebdavResource(HttpURL httpURL,
                      int action,
                      int depth,
                      boolean followRedirects)
            throws HttpException,
                   IOException
The constructor.
Parameters:
httpURL - The specified http URL.
action - The action to set properties of this resource.
depth - The depth to find properties.
followRedirects - shall redirects from the server be accepted

WebdavResource

public WebdavResource(String escapedHttpURL)
            throws HttpException,
                   IOException
The constructor. It must be put an escaped http URL as an argument.
Parameters:
escapedHttpURL - The escaped http URL string.

WebdavResource

public WebdavResource(String escapedHttpURL,
                      Credentials credentials)
            throws HttpException,
                   IOException
The constructor. It must be put an escaped http URL as an argument.
Parameters:
escapedHttpURL - The escaped http URL string.
credentials - The credentials used for Authentication.

WebdavResource

public WebdavResource(String escapedHttpURL,
                      Credentials credentials,
                      boolean followRedirects)
            throws HttpException,
                   IOException

WebdavResource

public WebdavResource(String escapedHttpURL,
                      String proxyHost,
                      int proxyPort)
            throws HttpException,
                   IOException
The constructor. It must be put an escaped http URL as an argument.
Parameters:
escapedHttpURL - The escaped http URL string.
proxyHost - The hostname of the proxy to use.
proxyPort - The port number of the proxy to use.

WebdavResource

public WebdavResource(String escapedHttpURL,
                      String proxyHost,
                      int proxyPort,
                      Credentials proxyCredentials)
            throws HttpException,
                   IOException
The constructor. It must be put an escaped http URL as an argument.
Parameters:
escapedHttpURL - The escaped http URL string.
proxyHost - The hostname of the proxy to use.
proxyPort - The port number of the proxy to use.
proxyCredentials - Credentials to use for proxy authentication.

WebdavResource

public WebdavResource(String escapedHttpURL,
                      boolean followRedirects)
            throws HttpException,
                   IOException

Method Details

abortTransaction

public boolean abortTransaction()
            throws IOException
Returns:
true if the transaction has been successfully committed, false otherwise

aclMethod

public boolean aclMethod(String path,
                         Ace[] aces)
            throws HttpException,
                   IOException
Updates the resource with a new set of aces.
Parameters:
path - the server relative path of the resource to which the given ACEs shall be applied
aces - the ACEs to apply
Returns:
true if the method succeeded

aclReportMethod

public Enumeration aclReportMethod(String path,
                                   Collection properties,
                                   int reportType)
            throws HttpException,
                   IOException
Execute REPORT method. This method is for the special Access Control Reports: - acl-principal-prop-set (not supported yet) - principal-match (not supported yet) - principal-property-search - principal-search-property-set (not supported yet)
Parameters:
path - the server relative path of the resource to request
properties - The named properties.
Returns:
an enumeration of ResponseEntity

aclfindMethod

public AclProperty aclfindMethod()
            throws HttpException,
                   IOException
Return the AclProperty for the current resource
Returns:
acl property, null if the server doesn't respond with AclProperty

aclfindMethod

public AclProperty aclfindMethod(String path)
            throws HttpException,
                   IOException
Return the AclProperty for the resource at the given path
Parameters:
path - the server relative path of the resource to request
Returns:
acl property, null if the server doesn't respond with AclProperty

bindMethod

public boolean bindMethod(String newBinding)
            throws HttpException,
                   IOException
Execute the BIND method for this WebdavResource, given an existing path to bind with.
Parameters:
newBinding - the new binding as a server relative path
Returns:
true if the method is succeeded.

bindMethod

public boolean bindMethod(String existingBinding,
                          String newBinding)
            throws HttpException,
                   IOException
Execute the BIND method given the new path to bind to an existing path.
Parameters:
existingBinding - the existing binding as a server relative path
newBinding - the new binding as a server relative path
Returns:
true if the method is succeeded.

checkinMethod

public boolean checkinMethod()
            throws HttpException,
                   IOException
Execute the CHECKIN method for this WebdavResource.
Returns:
true if the method is succeeded.

checkinMethod

public boolean checkinMethod(String path)
            throws HttpException,
                   IOException
Execute the CHECKIN method for the given path.
Parameters:
path - the server relative path of the resource to check in
Returns:
true if the method is succeeded.

checkoutMethod

public boolean checkoutMethod()
            throws HttpException,
                   IOException
Execute the CHECKOUT method for this WebdavResource.
Returns:
true if the method is succeeded.

checkoutMethod

public boolean checkoutMethod(String path)
            throws HttpException,
                   IOException
Execute the CHECKOUT method for the given path.
Parameters:
path - the server relative path of the resource to check out
Returns:
true if the method is succeeded.

close

public void close()
            throws IOException
Close the session of this client

commitTransaction

public boolean commitTransaction()
            throws IOException
Returns:
true if the transaction has been successfully committed, false otherwise

compareTo

public int compareTo(Object another)
Compare to the given another object.
Parameters:
another - the other WebdavResource object
Returns:
the value 0 if another is equal.

compareToWebdavResource

public int compareToWebdavResource(WebdavResource another)
Compare to the WebdavResource object.
Parameters:
another - the other WebdavResource object
Returns:
the value 0 if the argument is equal.

copyMethod

public boolean copyMethod(String destination)
            throws HttpException,
                   IOException
Execute the COPY method for the given destination path.
Parameters:
destination - the destination as a server relative path
Returns:
true if the method is succeeded.

copyMethod

public boolean copyMethod(String source,
                          String destination)
            throws HttpException,
                   IOException
Execute the COPY method the given source and destination.
Parameters:
source - the source resource as a server relative path
destination - the destination as a server relative path
Returns:
true if the method is succeeded.

createWebdavResource

protected WebdavResource createWebdavResource(HttpClient client)
Create a new WebdavResource object (as a seperate method so that it can be overridden by subclasses.
Parameters:
client - HttpClient to be used by this webdavresource.
Returns:
A new WebdavResource object.

deleteMethod

public boolean deleteMethod()
            throws HttpException,
                   IOException
Execute the DELETE method for this WebdavResource.
Returns:
true if the method is succeeded.

deleteMethod

public boolean deleteMethod(String path)
            throws HttpException,
                   IOException
Execute the DELETE method for the given path.
Parameters:
path - the server relative path of the resource to delete
Returns:
true if the method is succeeded.

discoverLock

protected WebdavState discoverLock(String owner,
                                   String path,
                                   WebdavState state)
Discover the given owner and locktoken and set the locktoken
Parameters:
owner - the activelock owner
path - the server relative path of the resource to request
state - the state to save the locktoken
Returns:
state probably having lock information renewly

discoverOwnLocks

public void discoverOwnLocks()
            throws HttpException,
                   IOException
Discover and refresh lock tokens.

discoverOwnLocks

public void discoverOwnLocks(String owner)
            throws HttpException,
                   IOException
Discover and refresh lock tokens for a specific owner.
Parameters:
owner - the owner who's locks are to be discovered.

endTransaction

protected boolean endTransaction(String path,
                                 int transactionStatus)
            throws IOException

equals

public boolean equals(Object obj)
Test the object.
Parameters:
obj - the other object
Returns:
true if it's equal.

executeHttpRequestMethod

public int executeHttpRequestMethod(HttpClient client,
                                    HttpMethod method)
            throws IOException,
                   HttpException
Execute the http request method. And get its status code.
Parameters:
client - The http client.
method - The http method.
Returns:
The status code.

exists

public boolean exists()
Returns the last known information about the existence of this resource. This is a wrapper method for getExistence. A previous call to the method setProperties might be necessary to update that information.
Returns:
true if the resource is known to exist
false if the resource is known not to exist or its status is unknown.

generateIfHeader

protected void generateIfHeader(HttpMethod method)
Generate and add the If header to the specified HTTP method.

generateTransactionHeader

protected void generateTransactionHeader(HttpMethod method)
Generates and adds the "Transaction" header if this method is part of an externally controlled transaction.

getActiveLockOwners

public Enumeration getActiveLockOwners()
Get the activelock owners for this resource.
Returns:
An enumeration of owners.

getAllowedMethods

public Enumeration getAllowedMethods()
Get the allowed methods, checked by HTTP OPTIONS.
Returns:
the allowed HTTP methods.
See Also:
optionsMethod(java.lang.String)

getChildResources

public WebdavResources getChildResources()
            throws HttpException,
                   IOException
Get all resources in this collection with the depth 1.
Returns:
resources in this collection with the depth 1.

getCreationDate

public long getCreationDate()
Get the value of DAV property, creationdate.
Returns:
The creationdate string.

getDavCapabilities

public Enumeration getDavCapabilities()
Get the WebDAV capabilities, checked by HTTP OPTIONS.
Returns:
the WebDAV capabilities.
See Also:
optionsMethod(java.lang.String)

getDefaultAction

public static int getDefaultAction()
Get the default action.
Returns:
The action type.

getDefaultDepth

public static int getDefaultDepth()
Get the default action.
Returns:
The depth.

getDisplayName

public String getDisplayName()
Get the value of DAV property, displayname.
Returns:
The displayname string.

getExistence

public boolean getExistence()
Returns the last known information about the existence of this resource. A previous call to the method setProperties might be necessary to update that information.
Returns:
true if the resource is known to exist
false if the resource is known not to exist or its status is unknown.

getFollowRedirects

public boolean getFollowRedirects()
Returns the current "follow redirects" flag.

getGetContentLength

public long getGetContentLength()
Get the value of DAV property, getcontentlength.
Returns:
The getcontentlength value.

getGetContentType

public String getGetContentType()
Get the value of DAV property, getcontenttype.
Returns:
The getcontenttype string.

getGetEtag

public String getGetEtag()
Get the value of DAV property, getetag.
Returns:
The getetag string.

getGetLastModified

public long getGetLastModified()
Get the value of DAV property, getlastmodified.
Returns:
The getlastmodified value.

getGetTempDir

public static String getGetTempDir()

Deprecated. The returned directory is not used by the GET method.

Get the default temporary directory for the GET method. The default temporary directory is "temp/".
Returns:
The temporary directory path. It's set by default, if it returns null.

getGetUseDisk

public static boolean getGetUseDisk()

Deprecated. This method always returns false.

Get the use disk flag for the GET method.
Returns:
The current flag of the use disk. By default, it's true.

getHost

public String getHost()
            throws URIException
Get the hostname of this WebdavResource.
Returns:
the hostname.

getHttpURL

public HttpURL getHttpURL()
Get the HttpURL of this WebdavResource.
Returns:
httpURL the http URL.

getHttpURLExceptForUserInfo

public HttpURL getHttpURLExceptForUserInfo()
            throws URIException
Get the HttpURL except for userinfo.
Returns:
httpURL the http URL.

getIsCollection

public boolean getIsCollection()
Get the value of DAV property, iscollection
Returns:
true if it is collection, otherwise false.

getIsHidden

public boolean getIsHidden()
Get the value of DAV property, ishidden.
Returns:
true if it is hidden, otherwise false.

getLockDiscovery

public LockDiscoveryProperty getLockDiscovery()
Get the value of DAV property, lockdiscovery.
Returns:
The lockdiscovery property.

getMethod

public boolean getMethod(File file)
            throws HttpException,
                   IOException
Execute the GET method for this WebdavResource path.
Parameters:
file - The local file.
Returns:
true if the method is succeeded.

getMethod

public boolean getMethod(String path,
                         File file)
            throws HttpException,
                   IOException
Execute the GET method for the given path.
Parameters:
path - the server relative path of the resource to get
file - The local file.
Returns:
true if the method is succeeded.

getMethodData

public InputStream getMethodData()
            throws HttpException,
                   IOException
Get InputStream for the GET method.
Returns:
InputStream

getMethodData

public InputStream getMethodData(String path)
            throws HttpException,
                   IOException
Get InputStream for the GET method for the given path.
Parameters:
path - the server relative path of the resource to get
Returns:
InputStream

getMethodDataAsString

public String getMethodDataAsString()
            throws HttpException,
                   IOException
Get data as a String for the GET method.
Returns:
the contents of this resource as a string

getMethodDataAsString

public String getMethodDataAsString(String path)
            throws HttpException,
                   IOException
Get data as a String for the GET method for the given path.
Parameters:
path - the server relative path of the resource to get
Returns:
the contents of the given resource as a string

getName

public String getName()
Get the name of this WebdavResource. If the decoding of the name fails, this method will not throw an exception but return the escaped name instead.
Returns:
the name of this WebdavResource.

getOverwrite

public boolean getOverwrite()
Get the current value of the overwrite flag for COPY, MOVE, BIND and REBIND.
Returns:
true if the current flag is overwriting.

getOwner

public String getOwner()
Get the owner string, as used for locking purposes.

getPath

public String getPath()
Get the path part of this WebdavResource. If the decoding of the path fails, this method will not throw an exception but return the escaped path instead.
Returns:
the path for this WebdavResource.
See Also:
HttpURL.getPath(), setPath(java.lang.String)

getResourceType

public ResourceTypeProperty getResourceType()
Get the value of DAV property, resourcetype.
Returns:
The resourcetype property.

getStatusCode

public int getStatusCode()
Get the lastest value of the status code by HTTP methods.
Returns:
The http status code.

getStatusMessage

public String getStatusMessage()
Get the lastest value of the status message by HTTP methods.
Returns:
The http status string.

getSupportedLock

public String getSupportedLock()
Get the value of DAV property, supportedlock.
Returns:
The supportedlock string.

getTransactionHandle

public String getTransactionHandle()
            throws IOException
Returns:
the current transaction handle or null if the client does not operate inside a transaction

headMethod

public boolean headMethod()
            throws HttpException,
                   IOException
Execute the HEAD method for this WebdavResource.
Returns:
true if the method is succeeded.

headMethod

public boolean headMethod(String path)
            throws HttpException,
                   IOException
Execute the HEAD method for the given path.
Parameters:
path - the server relative path of the resource to request
Returns:
true if the method is succeeded.

isCollection

public boolean isCollection()
Get the value of DAV property, resourcetype
Returns:
The resourcetype string.

isLocked

public boolean isLocked()
Test that this resource is locked.
Returns:
true if it's locked.

isTheClient

protected boolean isTheClient()
            throws URIException
Test that the httpURL is the same with the client.
Returns:
true if the given httpURL is the client for this resource.

labelMethod

public boolean labelMethod(String path,
                           String labelname,
                           int type)
            throws HttpException,
                   IOException
Execute a LABEL method on the given path, setting the given label
Parameters:
path - the server relative path of the resource to act on
labelname - the label to set
type - the type of action. One of:
  • LABEL_ADD
  • LABEL_REMOVE
  • LABEL_SET
Returns:
true if the method succeeded

labelMethod

public boolean labelMethod(String labelname,
                           int type)
            throws HttpException,
                   IOException
Execute a LABEL method on the current path, setting the given label
Parameters:
labelname - the label to set
type - the type of action. One of:
  • LABEL_ADD
  • LABEL_REMOVE
  • LABEL_SET
Returns:
true if the method succeeded

list

public String[] list()
Get an array of pathnames denoting the WebDAV resources in the collection denoted by this pathname.
Returns:
An array of pathnames denoting the resources, null if an IOException occurs.

listBasic

public Vector listBasic()
            throws HttpException,
                   IOException
Get an array of pathnames and basic information denoting the WebDAV resources in the denoted by this pathname. array 0: displayname array 1: getcontentlength array 2: iscollection or getcontentype array 3: getlastmodifieddate array 4: name
Returns:
An array of pathnames and more denoting the resources.

listWebdavResources

public WebdavResource[] listWebdavResources()
            throws HttpException,
                   IOException
Get an array of resources denoting the WebDAV child resources in the collection of this resources.
Returns:
An array of child resources in this resource.

lockDiscoveryPropertyFindMethod

public LockDiscoveryProperty lockDiscoveryPropertyFindMethod()
            throws HttpException,
                   IOException
Return the LockDiscoveryProperty for the current resource
Returns:
null if the server doesn't respond with a LockDiscoveryProperty

lockDiscoveryPropertyFindMethod

public LockDiscoveryProperty lockDiscoveryPropertyFindMethod(String path)
            throws HttpException,
                   IOException
Return the LockDiscoveryProperty for the resource at the given path
Parameters:
path - the server relative path of the resource to request
Returns:
null if the server doesn't respond with a LockDiscoveryProperty

lockMethod

public boolean lockMethod()
            throws HttpException,
                   IOException
Execute the LOCK method for this WebdavResource. This method tries to acquire an exclusive write lock with a timeout of 120 seconds.
Returns:
true if the method is succeeded.

lockMethod

public boolean lockMethod(String path)
            throws HttpException,
                   IOException
Execute the LOCK method for the given path. This method tries to acquire an exclusive write lock with a timeout of 120 seconds.
Parameters:
path - the server relative path of the resource to lock
Returns:
true if the method is succeeded.

lockMethod

public boolean lockMethod(String path,
                          String owner,
                          int timeout)
            throws HttpException,
                   IOException
Execute the LOCK method for the given path. This method tries to acquire an exclusive write lock with the given timeout value.
Parameters:
path - the server relative path of the resource to lock
owner - The owner string.
timeout - the timeout value.
Returns:
true if the method is succeeded.

lockMethod

public boolean lockMethod(String path,
                          String owner,
                          int timeout,
                          short lockType)
            throws HttpException,
                   IOException
Execute the LOCK method for the given path. This method tries to acquire an exclusive write lock with the given timeout value.
Parameters:
path - the server relative path of the resource to lock
owner - The owner string.
timeout - the timeout value.
Returns:
true if the method is succeeded.

lockMethod

public boolean lockMethod(String path,
                          String owner,
                          int timeout,
                          short lockType,
                          int depth)
            throws HttpException,
                   IOException
Execute the LOCK method for the given path. This method tries to acquire an exclusive write lock with the given timeout value.
Parameters:
path - the server relative path of the resource to lock
owner - The owner string.
timeout - the timeout value.
Returns:
true if the method is succeeded.

lockMethod

public boolean lockMethod(String path,
                          String owner,
                          short timeout)
            throws HttpException,
                   IOException

Deprecated. The timeout value MUST NOT be greater than 2^32-1.

Execute the LOCK method for the given path.

lockMethod

public boolean lockMethod(String owner,
                          int timeout)
            throws HttpException,
                   IOException
Execute the LOCK method for this WebdavResource. This method tries to acquire an exclusive write lock with the given timeout value.
Parameters:
owner - the owner string.
timeout - the timeout
Returns:
true if the method is succeeded.

lockMethod

public boolean lockMethod(String owner,
                          short timeout)
            throws HttpException,
                   IOException

Deprecated. The timeout value MUST NOT be greater than 2^32-1.

Execute the LOCK method for this WebdavResource.

mkWorkspaceMethod

public boolean mkWorkspaceMethod()
            throws HttpException,
                   IOException
Execute the MKWORKSPACE method for this WebdavResource.
Returns:
true if the method is succeeded.

mkWorkspaceMethod

public boolean mkWorkspaceMethod(String path)
            throws HttpException,
                   IOException
Execute the MKCOL method for the given path.
Parameters:
path - the server relative path at which to create a new workspace resource
Returns:
true if the method is succeeded.

mkcolMethod

public boolean mkcolMethod()
            throws HttpException,
                   IOException
Execute the MKCOL method for this WebdavResource.
Returns:
true if the method is succeeded.

mkcolMethod

public boolean mkcolMethod(String path)
            throws HttpException,
                   IOException
Execute the MKCOL method for the given path.
Parameters:
path - the server relative path at which to create a new collection resource
Returns:
true if the method is succeeded.

moveMethod

public boolean moveMethod(String destination)
            throws HttpException,
                   IOException
Execute the MOVE method for this WebdavReource.
Parameters:
destination - the destination to move to as a server relative path
Returns:
true if the method is succeeded.

moveMethod

public boolean moveMethod(String source,
                          String destination)
            throws HttpException,
                   IOException
Execute the MOVE method for the given source and destination.
Parameters:
source - the source resource as a server relativ path
destination - the destination to move to as a server relative path
Returns:
true if the method is succeeded.

optionsMethod

public boolean optionsMethod()
            throws HttpException,
                   IOException
Execute OPTIONS method for this WebdavResource.
Returns:
true if the method is succeeded.

optionsMethod

public Enumeration optionsMethod(HttpURL httpURL)
            throws HttpException,
                   IOException
Execute OPTIONS method for the given http URL.
Parameters:
httpURL - the http URL.
Returns:
the allowed methods and capabilities.

optionsMethod

public Enumeration optionsMethod(HttpURL httpURL,
                                 int type)
            throws HttpException,
                   IOException
Execute OPTIONS method for the given http URL, DELTAV
Parameters:
httpURL - the http URL.
Returns:
the allowed methods and capabilities.

optionsMethod

public boolean optionsMethod(String path)
            throws HttpException,
                   IOException
Execute OPTIONS method for the given path.
Parameters:
path - the server relative path of the resource to request
Returns:
true if the method is succeeded.

optionsMethod

public boolean optionsMethod(String path,
                             String aMethod)
            throws HttpException,
                   IOException
Execute OPTIONS method for the given path.
Parameters:
path - the server relative path to send the request
aMethod - a method to check it's supported.
Returns:
true if the method is succeeded.

optionsMethod

public Enumeration optionsMethod(String path,
                                 int type)
            throws HttpException,
                   IOException
Execute OPTIONS method for the given path.
Parameters:
path - the server relative path of the resource to request
Returns:
the allowed methods and capabilities.

parseDate

protected Date parseDate(String dateValue)
Parse the java.util.Date string for HTTP-date.
Returns:
The parsed date.

pollMethod

public boolean pollMethod(String contentLocation,
                          int subscriptionId)
            throws HttpException,
                   IOException
Asks the server whether events for a given subscription are fired.
Parameters:
contentLocation - URL path returned by the SUBSCRIBE methods Content-Location header
subscriptionId - id of the subscription
Returns:
true if an event was fired

pollMethod

public boolean pollMethod(Subscription subscription)
            throws HttpException,
                   IOException
Asks the server whether events for a given subscription are fired.
Parameters:
subscription - the subscription to ask for
Returns:
true if an event was fired

principalCollectionSetFindMethod

public PrincipalCollectionSetProperty principalCollectionSetFindMethod()
            throws HttpException,
                   IOException
Get the PrincipalCollectionSetProperty for the current resource.
Returns:
principal collection set Property, null if the server doesn't respond with a PrincipalCollectionSetProperty

principalCollectionSetFindMethod

public PrincipalCollectionSetProperty principalCollectionSetFindMethod(String path)
            throws HttpException,
                   IOException
Get the PrincipalCollectionSetProperty for the resource.
Parameters:
path - the server relative path of the resource to request
Returns:
principal collection set Property, null if the server doesn't respond with a PrincipalCollectionSetProperty

processProperty

protected void processProperty(Property property)
Process a property, setting various member variables depending on what the property is.
Parameters:
property - The property to process.

propfindMethod

public Enumeration propfindMethod(String propertyName)
            throws HttpException,
                   IOException
Execute PROPFIND method for this WebdavResource. Get list of given WebDAV properties on this WebDAV resource.
Parameters:
propertyName - the WebDAV property to find.
Returns:
Enumeration list of WebDAV properties on a resource.

propfindMethod

public Enumeration propfindMethod(String path,
                                  String propertyName)
            throws HttpException,
                   IOException
Execute PROPFIND method for the given WebdavResource path. Get list of given WebDAV properties on this WebDAV resource.
Parameters:
path - the server relative path of the resource to request
propertyName - the WebDAV property to find.
Returns:
Enumeration list of WebDAV properties on a resource.

propfindMethod

public Enumeration propfindMethod(String path,
                                  Vector properties)
            throws HttpException,
                   IOException
Execute PROPFIND method for the given path and properties. Get list of given WebDAV properties on the given resource.
Parameters:
path - the server relative path of the resource to request
properties - the WebDAV properties to find.
Returns:
Enumeration list of WebDAV properties on a resource.

propfindMethod

public Enumeration propfindMethod(String path,
                                  int depth)
            throws HttpException,
                   IOException
Execute PROPFIND method with allprop for the given path. Get list of all WebDAV properties on the given resource.

Once used this method, the the status code in the 207 reponse is need to be set for the method of WebdavResource.

The values of DepthSupport.DEPTH_0, DepthSupport.DEPTH_1, DepthSupport.DEPTH_INFINITY is possbile for the depth.

Parameters:
path - the server relative path of the resource to request
depth -
Returns:
an enumeration of ResponseEntity

propfindMethod

public Enumeration propfindMethod(String path,
                                  int depth,
                                  Vector properties)
            throws HttpException,
                   IOException
Execute PROPFIND method with by propname for the given path. Get list of named WebDAV properties on the given resource.

Once used this method, the the status code in the 207 reponse is need to be set for the method of WebdavResource.

The values of DepthSupport.DEPTH_0, DepthSupport.DEPTH_1 DepthSupport.DEPTH_INFINITY is possbile for the depth.

Parameters:
path - the server relative path of the resource to request
depth - The depth.
properties - The named properties.
Returns:
an enumeration of ResponseEntity

propfindMethod

public Enumeration propfindMethod(Vector properties)
            throws HttpException,
                   IOException
Execute PROPFIND method for this WebdavResource. Get list of given WebDAV properties on this WebDAV resource.
Parameters:
properties - the WebDAV properties to find.
Returns:
Enumeration list of WebDAV properties on a resource.

propfindMethod

public Enumeration propfindMethod(int depth)
            throws HttpException,
                   IOException
Execute PROPFIND method with allprop for this WebdavResource. Get list of all WebDAV properties on this WebDAV resource.

Once used this method, the the status code in the 207 reponse is need to be set for the method of WebdavResource.

The values of DepthSupport.DEPTH_0, DepthSupport.DEPTH_1, DepthSupport.DEPTH_INFINITY is possbile for the depth.

Parameters:
depth -
Returns:
an enumeration of ResponseEntity

propfindMethod

public Enumeration propfindMethod(int depth,
                                  Vector properties)
            throws HttpException,
                   IOException
Execute PROPFIND method with by propname for this resource. Get list of named WebDAV properties on this resource.

Once used this method, the the status code in the 207 reponse is need to be set for the method of WebdavResource.

The values of DepthSupport.DEPTH_0, DepthSupport.DEPTH_1 DepthSupport.DEPTH_INFINITY is possbile for the depth.

Parameters:
depth - The depth.
properties - The named properties.
Returns:
an enumeration of ResponseEntity

proppatchMethod

public boolean proppatchMethod(Hashtable properties)
            throws HttpException,
                   IOException

Deprecated. it could be removed after the major version changes

Execute PROPATCH method for this WebdavResource.
Parameters:
properties - name and value pairs to set (name can be a String or PropertyName)
Returns:
true if the method is succeeded.

proppatchMethod

public boolean proppatchMethod(Hashtable properties,
                               boolean action)
            throws HttpException,
                   IOException
Execute PROPATCH method for this resource with the given properties.
Parameters:
properties - the name(= String or PropertyName and value(= String) pairs for proppatch action If the proppatch action is being removed, the value is null or any.
action - true if it's being set, false if it's being removed
Returns:
true if the method is succeeded.

proppatchMethod

public boolean proppatchMethod(String path,
                               Hashtable properties)
            throws HttpException,
                   IOException

Deprecated. it could be removed after the major version changes

Execute PROPATCH method for the given WebdavResource.
Parameters:
path - the server relative path of the resource to act on
properties - name and value pairs to set (name can be a String or PropertyName)
Returns:
true if the method is succeeded.

proppatchMethod

public boolean proppatchMethod(String path,
                               Hashtable properties,
                               boolean action)
            throws HttpException,
                   IOException
Execute PROPATCH method for the specified resource with the given properties.
Parameters:
path - the server relative path of the resource to act on
properties - the name(= String or PropertyName and value(= String) pairs for proppatch action If the proppatch action is being removed, the value is null or any.
action - true if it's being set, false if it's being removed
Returns:
true if the method is succeeded.

proppatchMethod

public boolean proppatchMethod(String propertyName,
                               String propertyValue)
            throws HttpException,
                   IOException

Deprecated. it could be removed after the major version changes

Execute PROPATCH method for this WebdavResource.
Parameters:
propertyName - the name of the property to set
propertyValue - the value of the property to set
Returns:
true if the method is succeeded.

proppatchMethod

public boolean proppatchMethod(String path,
                               String propertyName,
                               String propertyValue)
            throws HttpException,
                   IOException

Deprecated. it could be removed after the major version changes

Execute PROPATCH method for the given WebdavResource.
Parameters:
path - the server relative path of the resource to act on
propertyName - the property name in "DAV:" namespace
propertyValue - the property value string
Returns:
true if the method is succeeded

proppatchMethod

public boolean proppatchMethod(String path,
                               String propertyName,
                               String propertyValue,
                               boolean action)
            throws HttpException,
                   IOException
Execute PROPATCH method for the specified resource with the given property.
Parameters:
path - the server relative path of the resource to act on
propertyName - the property name string (in "DAV:" namespace)
propertyValue - the property value string If the proppatch action is being removed, the value is null or any.
action - true if it's to be set, false if it's to be removed
Returns:
true if the method is succeeded

proppatchMethod

public boolean proppatchMethod(String propertyName,
                               String propertyValue,
                               boolean action)
            throws HttpException,
                   IOException
Execute PROPATCH method for this resource with the given property.
Parameters:
propertyName - the property name string (in "DAV:" namespace)
propertyValue - the property value string If the proppatch action is being removed, the value is null or any.
action - true if it's being set, false if it's being removed
Returns:
true if the method is succeeded.

proppatchMethod

public boolean proppatchMethod(String path,
                               PropertyName propertyName,
                               String propertyValue)
            throws HttpException,
                   IOException

Deprecated. it could be removed after the major version changes

Execute PROPATCH method for the given WebdavResource.
Parameters:
path - the server relative path of the resource to act on
propertyName - the property name.
propertyValue - the property value.
Returns:
true if the method is succeeded.

proppatchMethod

public boolean proppatchMethod(String path,
                               PropertyName propertyName,
                               String propertyValue,
                               boolean action)
            throws HttpException,
                   IOException
Execute PROPATCH method for the given resource with the given properties.
Parameters:
path - the server relative path of the resource to act on
propertyName - the property name
propertyValue - the property value string If the proppatch action is being removed, the value is null or any.
action - true if it's to be set, false if it's to be removed
Returns:
true if the method is succeeded

proppatchMethod

public boolean proppatchMethod(PropertyName propertyName,
                               String propertyValue)
            throws HttpException,
                   IOException

Deprecated. it could be removed after the major version changes

Execute PROPATCH method for this WebdavResource.
Parameters:
propertyName - the name of the property to set
propertyValue - the value of the property to set
Returns:
true if the method is succeeded.

proppatchMethod

public boolean proppatchMethod(PropertyName propertyName,
                               String propertyValue,
                               boolean action)
            throws HttpException,
                   IOException
Execute PROPATCH method for this resource with the given property.
Parameters:
propertyName - the name of the property to set
propertyValue - the value of the property to set If the proppatch action is being removed, the value is null or any.
action - true if it's being set, false if it's being removed
Returns:
true if the method is succeeded

putMethod

public boolean putMethod(File file)
            throws HttpException,
                   IOException
Execute the PUT method for this WebdavResource.
Parameters:
file - the filename to get on local.
Returns:
true if the method is succeeded.

putMethod

public boolean putMethod(InputStream is)
            throws HttpException,
                   IOException
Execute the PUT method for this resource.
Parameters:
is - The input stream.
Returns:
true if the method is succeeded.

putMethod

public boolean putMethod(String data)
            throws HttpException,
                   IOException
Execute the PUT method for this WebdavResource.
Parameters:
data - String data to send.
Returns:
true if the method is succeeded.

putMethod

public boolean putMethod(String path,
                         File file)
            throws HttpException,
                   IOException
Execute the PUT method for the given path.
Parameters:
path - the server relative path to put the given file
file - the filename to get on local.
Returns:
true if the method is succeeded.

putMethod

public boolean putMethod(String path,
                         InputStream is)
            throws HttpException,
                   IOException
Execute the PUT method for the given path.
Parameters:
path - the server relative path to put the data
is - The input stream.
Returns:
true if the method is succeeded.

putMethod

public boolean putMethod(String path,
                         String data)
            throws HttpException,
                   IOException
Execute the PUT method for the given path.
Parameters:
path - the server relative path to put the data
data - String to send.
Returns:
true if the method is succeeded.

putMethod

public boolean putMethod(String path,
                         URL url)
            throws HttpException,
                   IOException
Execute the PUT method for the given path from the given url.
Parameters:
path - the server relative path to put the data
url - The URL to get a resource.
Returns:
true if the method is succeeded.

putMethod

public boolean putMethod(String path,
                         byte[] data)
            throws HttpException,
                   IOException
Execute the PUT method for the given path.
Parameters:
path - the server relative path to put the data
data - The byte array.
Returns:
true if the method is succeeded.

putMethod

public boolean putMethod(URL url)
            throws HttpException,
                   IOException
Execute the PUT method for this resource from the given url. It's like a streaming copy about a resource of the specified remote url to another remote url of this resource.
Parameters:
url - The URL to get a resource.
Returns:
true if the method is succeeded.

putMethod

public boolean putMethod(byte[] data)
            throws HttpException,
                   IOException
Execute the PUT method for this resource.
Parameters:
data - The byte array.
Returns:
true if the method is succeeded.

rebindMethod

public boolean rebindMethod(String newBinding)
            throws HttpException,
                   IOException
Execute the Rebind method for this WebdavResource given the new Resource to bind with. The REBIND method removes a binding to a resource from one collection, and adds a binding to that resource into another collection. It is effectively an atomic form of a MOVE request.
Parameters:
newBinding - the new binding as a server relative path
Returns:
true if the method is succeeded.

rebindMethod

public boolean rebindMethod(String existingBinding,
                            String newBinding)
            throws HttpException,
                   IOException
Execute the Rebind method given a resource to rebind and the new Resource to bind with. The REBIND method removes a binding to a resource from one collection, and adds a binding to that resource into another collection. It is effectively an atomic form of a MOVE request
Parameters:
existingBinding - the existing binding as a server relative path
newBinding - the new binding as a server relative path
Returns:
true if the method is succeeded.

refresh

protected void refresh()
            throws HttpException,
                   IOException
Refresh the properties of this resource without changing the status of the previous command

reportMethod

public Enumeration reportMethod(HttpURL httpURL,
                                String sQuery,
                                int depth)
            throws HttpException,
                   IOException

reportMethod

public Enumeration reportMethod(HttpURL httpURL,
                                Vector properties)
            throws HttpException,
                   IOException

reportMethod

public Enumeration reportMethod(HttpURL httpURL,
                                Vector properties,
                                Vector histUri,
                                int depth)
            throws HttpException,
                   IOException

reportMethod

public Enumeration reportMethod(HttpURL httpURL,
                                Vector properties,
                                int depth)
            throws HttpException,
                   IOException

reportMethod

public Enumeration reportMethod(HttpURL httpURL,
                                int depth)
            throws HttpException,
                   IOException
Execute the REPORT method.

retrieveSessionInstance

public HttpClient retrieveSessionInstance()
            throws IOException
Retrieve the current http client for this resource.
Returns:
The http client.

setAllProp

protected void setAllProp(int depth)
            throws HttpException,
                   IOException
Set all properties for this resource.
Parameters:
depth - The depth

setBasicProperties

protected void setBasicProperties(int depth)
            throws HttpException,
                   IOException
Sets the basic properties on a resource by indirectly issuing a PROPFIND on the resource.

Properties retrieved include:

  • displayname
  • getcontentlength
  • getcontenttype
  • resourcetype
  • getlastmodified
  • lockdiscovery
Parameters:
depth - The depth to find properties.

setClient

protected void setClient()
            throws IOException
Set the client for this resource.

setClient

protected void setClient(HttpURL httpURL)
            throws IOException
Set the client for this resource and the given http URL.
Parameters:
httpURL - The http URL.

setContentType

public void setContentType(String contentType)
Set the content-type to use for this resource, for PUTs.
Parameters:
contentType - The content-type string.

setCreationDate

protected void setCreationDate(String creationDate)
Set the value of DAV property, creationdate.
Parameters:
creationDate - The creationdate string.

setCreationDate

protected void setCreationDate(long creationDate)
Set the value of DAV property, creationdate.
Parameters:
creationDate - The creationdate string.

setDefaultAction

public static void setDefaultAction(int action)
Set the default action for this resource. The default action is set as 'BASIC' for the first time. ex) WebdavResource.NOACTION WebdavResource.NAME WebdavResource.BASIC WebdavResource.DEFAULT WebdavResource.ALL
Parameters:
action - The action type.

setDefaultDepth

public static void setDefaultDepth(int depth)
Set the default action for this resource. ex) DepthSupport.DEPTH_0 DepthSupport.DEPTH_1 DepthSupport.DEPTH_INFINITY
Parameters:
depth - The depth.

setDefaultProperties

protected void setDefaultProperties(int depth)
            throws HttpException,
                   IOException
Set the default properties on the resource by indirectly issuing a PROPFIND request for a default set of properties.

Properties retrieved include:

  • creationdate
  • displayname
  • getcontentlanguage
  • getcontentlength
  • getcontenttype
  • getetag
  • getlastmodified
  • lockdiscovery
  • resourcetype
  • source
  • supportedlock
Parameters:
depth - The depth to find properties.

setDisplayName

protected void setDisplayName(String displayName)
Set the value of DAV property, displayname.
Parameters:
displayName - The displayname string.

setEncodeURLs

public void setEncodeURLs(boolean encodeURLs)

Deprecated. No longer has any effect.

Set the URL encoding flag for this http URL.
Parameters:
encodeURLs - true if it is encoded.

setExistence

protected void setExistence(boolean exists)
Set its existence.
Parameters:
exists - The boolean value to be set for its existence.

setFollowRedirects

public void setFollowRedirects(boolean value)
Sets a flag indicating that redirect responses from the server shall be followed.

setGetContentLength

protected void setGetContentLength(String getContentLength)
Set the value of DAV property, getcontentlength.
Parameters:
getContentLength - The getcontentlength value.

setGetContentLength

protected void setGetContentLength(long getContentLength)
Set the value of DAV property, getcontentlength.
Parameters:
getContentLength - The getcontentlength value.

setGetContentType

protected void setGetContentType(String getContentType)
Set the value of DAV property, getcontenttype.
Parameters:
getContentType - The getcontenttype string.

setGetEtag

protected void setGetEtag(String getEtag)
Set the value of DAV property, getetag.
Parameters:
getEtag - The getetag string.

setGetLastModified

protected void setGetLastModified(String getLastModified)
Set the value of DAV property, getlastmodified.
Parameters:
getLastModified - The getlastmodified value.

setGetLastModified

protected void setGetLastModified(long getLastModified)
Set the value of DAV property, getlastmodified.
Parameters:
getLastModified - The getlastmodified value.
See Also:
setGetLastModified(java.lang.String)

setGetTempDir

public static void setGetTempDir(String tempDir)

Deprecated. The given directory will not be used.

Get the default temporary directory for the GET method.
Parameters:
tempDir - The temporary directory.

setGetUseDisk

public static void setGetUseDisk(boolean useDisk)

Deprecated. This method has no effect.

Set the use disk flag for the GET method.
Parameters:
useDisk - The use disk flag.

setHttpURL

public void setHttpURL(HttpURL httpURL)
            throws HttpException,
                   IOException
Set the HttpURL for this WebdavResource.
Parameters:
httpURL - the specified HttpURL.
See Also:
setHttpURL(java.lang.String), setUserInfo(java.lang.String, java.lang.String), setPath(java.lang.String)

setHttpURL

public void setHttpURL(HttpURL httpURL,
                       String additionalPath)
            throws HttpException,
                   IOException
Set the HttpURL for this WebdavResource.
Parameters:
httpURL - The specified HttpURL.
additionalPath - The added relative path.
See Also:
setHttpURL(java.lang.String), setUserInfo(java.lang.String, java.lang.String), setPath(java.lang.String)

setHttpURL

public void setHttpURL(HttpURL httpURL,
                       String additionalPath,
                       int action)
            throws HttpException,
                   IOException
Set the HttpURL for this WebdavResource. It must be put an escaped path part of the http URL as an argument.
Parameters:
httpURL - The specified HttpURL.
additionalPath - The added relative path.
action - The action to decide, which properties to find.

setHttpURL

public void setHttpURL(HttpURL httpURL,
                       String additionalPath,
                       int action,
                       int depth)
            throws HttpException,
                   IOException
Set the HttpURL for this WebdavResource. It must be put an escaped path part of the http URL as an argument.
Parameters:
httpURL - The specified HttpURL.
additionalPath - The added relative path.
action - The action to decide, which properties to find.
depth - The depth.

setHttpURL

public void setHttpURL(HttpURL httpURL,
                       int depth)
            throws HttpException,
                   IOException
Set the HttpURL for this WebdavResource.
Parameters:
httpURL - the specified HttpURL.
depth - The depth to find properties.
See Also:
setHttpURL(java.lang.String), setUserInfo(java.lang.String, java.lang.String), setPath(java.lang.String)

setHttpURL

public void setHttpURL(HttpURL httpURL,
                       int action,
                       int depth)
            throws HttpException,
                   IOException
Set the HttpURL for this WebdavResource.
Parameters:
httpURL - the specified HttpURL.
action - The action to decide, which properties to find.
depth - The depth to find properties.

setHttpURL

public void setHttpURL(String escapedHttpURL)
            throws HttpException,
                   IOException
Set the HttpURL of this WebdavResource. It must be put an escaped http URL as an argument.
Parameters:
escapedHttpURL - The escaped http URL string.
See Also:
setHttpURL(HttpURL), setUserInfo(java.lang.String, java.lang.String), setPath(java.lang.String)

setIsCollection

protected void setIsCollection(String isCollection)
Set the value of DAV property, iscollection
Parameters:
isCollection -

setIsCollection

protected void setIsCollection(boolean isCollection)
Set the value of DAV property, iscollection
Parameters:
isCollection -

setIsHidden

protected void setIsHidden(String isHidden)
Set the value of DAV property, ishidden.
Parameters:
isHidden -

setIsHidden

protected void setIsHidden(boolean isHidden)
Set the value of DAV property, ishidden.
Parameters:
isHidden -

setLockDiscovery

protected void setLockDiscovery(LockDiscoveryProperty lockDiscovery)
Set the value of DAV property, lockdiscovery.
Parameters:
lockDiscovery - The lockdiscovery property.

setNameProperties

protected void setNameProperties(int depth)
            throws HttpException,
                   IOException
Set only the displayname property for this resource.
Parameters:
depth - The depth to find properties.

setNamedProp

protected void setNamedProp(int depth,
                            Vector propertyNames)
            throws HttpException,
                   IOException
Set the named properties for this resource.
Parameters:
depth - The depth.
propertyNames - The property-names.

setOverwrite

public void setOverwrite(boolean overwrite)
Set the overwrite flag for COPY, MOVE, BIND and REBIND. Should be set before the method is executed.
Parameters:
overwrite - the overwrite flag

setPath

public void setPath(String path)
            throws HttpException,
                   IOException
Set the path part of this WebdavResource.
Parameters:
path - the specified path.
See Also:
setHttpURL(HttpURL), setHttpURL(java.lang.String), setUserInfo(java.lang.String, java.lang.String)

setProperties

public void setProperties(int depth)
            throws HttpException,
                   IOException
Set the properties for this resource.
Parameters:
depth - the depth to which properties shall be found

setProperties

public void setProperties(int action,
                          int depth)
            throws HttpException,
                   IOException
Set the properties for this resource.
Parameters:
action - The action to find properties for this resource.
depth - the depth to which properties shall be found

setResourceType

protected void setResourceType(ResourceTypeProperty resourceType)
Set the value of DAV property, resourcetype.
Parameters:
resourceType - The resourcetype property.

setStatusCode

protected void setStatusCode(int statusCode)
Set the lastest value of the status code by HTTP methods.
Parameters:
statusCode - the HTTP status code.

setStatusCode

protected void setStatusCode(int statusCode,
                             String message)
Set the lastest value of the status code by HTTP methods.
Parameters:
statusCode - the HTTP status code.
message - the additional message.

setSupportedLock

protected void setSupportedLock(String supportedLock)
Set the value of DAV property, supportedlock.
Parameters:
supportedLock - The supportedlock string.

setUserInfo

public void setUserInfo(String userName,
                        String password)
            throws HttpException,
                   IOException
Set the userinfo part of this WebdavResource.
See Also:
setHttpURL(HttpURL), setHttpURL(java.lang.String), setPath(java.lang.String)

setWebdavProperties

protected void setWebdavProperties(Enumeration responses)
            throws HttpException,
                   IOException
Set WebDAV properties following to the given http URL. This method is fundamental for getting information of a collection.
Parameters:
responses - An enumeration over ResponseEntity items, one for each resource for which information was returned via PROPFIND.

startTransaction

public boolean startTransaction(String owner,
                                int timeout)
            throws IOException
Parameters:
owner - the owner of this transaction
timeout - timeout in milleseconds
Returns:
true if the transaction has been successfully started, false otherwise

subscribeMethod

public Subscription subscribeMethod(String path,
                                    String notificationType,
                                    String callback,
                                    long notificationDelay,
                                    int depth,
                                    long lifetime)
            throws HttpException,
                   IOException
Subscribes for notifications for modifications of WebDAV resources.
Parameters:
path - URL path of the resource that is to be subscribed
notificationType -
callback - the URL to be registered for notification, may be null if no callback shall be registered.
notificationDelay -
depth - the depth of the subscription (for valid values see DepthSupport)
lifetime - duration of that subscription in seconds (Note: the server may change this and return an other one; see Subscription.getLifetime().
Returns:
a Subscription or null if an error occurs

subscribeMethod

public boolean subscribeMethod(String path,
                               int subscriptionId)
            throws HttpException,
                   IOException
Refreshes a subscription.
Returns:
true on success.

subscribeMethod

public boolean subscribeMethod(Subscription subscription)
            throws HttpException,
                   IOException
Refreshes a subscription.
Parameters:
subscription - The subscription to be refreshed.
Returns:
true on success

toString

public String toString()
Return the http URL string.
Returns:
the http URL string.

unbindMethod

public boolean unbindMethod()
            throws HttpException,
                   IOException
Execute the UNBIND method for this WebdavResource.
Returns:
true if the method is succeeded.

unbindMethod

public boolean unbindMethod(String binding)
            throws HttpException,
                   IOException
Execute the UNBIND method given the resource to Unbind.
Parameters:
binding - the server relative path of the resource to unbind
Returns:
true if the method is succeeded.

uncheckoutMethod

public boolean uncheckoutMethod()
            throws HttpException,
                   IOException
Execute the CHECKOUT method for this WebdavResource.
Returns:
true if the method is succeeded.

uncheckoutMethod

public boolean uncheckoutMethod(String path)
            throws HttpException,
                   IOException
Execute the CHECKOUT method for the given path.
Parameters:
path - the server relative path of the resource to act on
Returns:
true if the method is succeeded.

unlockMethod

public boolean unlockMethod()
            throws HttpException,
                   IOException
Execute the Unlock method for this WebdavResource.
Returns:
true if the method is succeeded.

unlockMethod

public boolean unlockMethod(String path)
            throws HttpException,
                   IOException
Execute the Unlock method for the given path.
Parameters:
path - the server relative path of the resource to unlock
Returns:
true if the method is succeeded.

unlockMethod

public boolean unlockMethod(String path,
                            String owner)
            throws HttpException,
                   IOException
Execute the Unlock method for the given path.
Parameters:
path - the server relative path of the resource to unlock
Returns:
true if the method is succeeded.

unsubscribeMethod

public boolean unsubscribeMethod(String path,
                                 int subscriptionId)
            throws HttpException,
                   IOException
Cancels a subscription.
Parameters:
path - URL path for that was subscribed
Returns:
true on success

unsubscribeMethod

public boolean unsubscribeMethod(Subscription subscription)
            throws HttpException,
                   IOException
Cancels a subscription.
Parameters:
subscription -
Returns:
true on success

updateMethod

public boolean updateMethod(String target)
            throws HttpException,
                   IOException
Update this resource to the specified target
Parameters:
target - the path of the history element to update this resource from
Returns:
true if the method has succeeded

updateMethod

public boolean updateMethod(String path,
                            String target)
            throws HttpException,
                   IOException
Update the specified resource to the specified target
Parameters:
path - the server relative path of the resource to update
target - path of the target to update from (history resource)
Returns:
true if the method has succeeded

versionControlMethod

public boolean versionControlMethod(String path)
            throws HttpException,
                   IOException

versionControlMethod

public boolean versionControlMethod(String path,
                                    String target)
            throws HttpException,
                   IOException