Class WebdavResource
- java.lang.Object
-
- org.apache.webdav.lib.WebdavSession
-
- org.apache.webdav.lib.WebdavResource
-
public class WebdavResource extends WebdavSession
The classWebdavResourceis 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
Fields Modifier and Type Field Description static intALLThe action setting the all properties for this resource.protected java.util.EnumerationallowedMethodsThe allowed HTTP methods.static intBASICThe action setting the basic properties for this resource.protected WebdavResourceschildResourcesTable of the hrefs gotten in a collection.protected longcreationDateAn WebDAV property, creationdate.static java.lang.StringCREATIONDATEThe creationdate property.protected java.util.EnumerationdavCapabilitiesThe capabilities of the WebDAV server.static intDEFAULTThe action setting the default DAV properties for this resource.protected static intdefaultActionThe default action to find properties.protected static intdefaultDepthThe default depth for WebDAV methods.static java.lang.StringdefaultOwnerOwner information for locking and unlocking.protected java.lang.StringdisplayNameAn WebDAV property, displayname.static java.lang.StringDISPLAYNAMEThe displayname property.protected booleanexistsAn WebdavResource flag to check its existence;static java.lang.StringFALSEThe false constant string.protected booleanfollowRedirectsstatic java.text.SimpleDateFormat[]formatsDate formats using for Date parsing.static java.lang.StringGETCONTENTLANGUAGEThe getcontentlanguage property.protected longgetContentLengthAn WebDAV property, getcontentlength.static java.lang.StringGETCONTENTLENGTHThe getcontentlength property.protected java.lang.StringgetContentTypeAn WebDAV property, getcontenttype.static java.lang.StringGETCONTENTTYPEThe getcontenttype property.protected java.lang.StringgetEtagAn WebDAV property, getetag.static java.lang.StringGETETAGThe getetag property.protected longgetLastModifiedAn WebDAV property, getlastmodified.static java.lang.StringGETLASTMODIFIEDThe getlastmodifed property.protected static java.util.TimeZonegmtZoneGMT timezone.protected java.util.MapheadersMap of additional headersprotected org.apache.commons.httpclient.HttpURLhttpURLThe HttpURL to represent a WebDAV resource.protected booleanisCollectionAn WebDAV property, iscollection.static java.lang.StringISCOLLECTIONThe iscollection property.protected booleanisHiddenAn WebDAV property, ishidden.static java.lang.StringISHIDDENThe ishidden property.static intLABEL_ADDstatic intLABEL_REMOVEstatic intLABEL_SETprotected intlatestStatusCodeAn status code performed by HTTP methods at the most recent.protected java.lang.StringlatestStatusMessageAn status message performed by HTTP methods at the most recent.protected LockDiscoveryPropertylockDiscoveryAn WebDAV property, lockdiscovery.static java.lang.StringLOCKDISCOVERYThe lockdiscovery property.static intNAMEThe action setting only the displayname for this resource.static intNOACTIONNo action to find properties for this resource.static intOPTIONS_VERSION_HISTORYstatic intOPTIONS_WORKSPACEprotected booleanoverwriteAn WebdavResource flag to check overwriting;protected java.lang.StringownerOwner information for locking and unlocking.protected ResourceTypePropertyresourceTypeAn WebDAV property, resourcetype.static java.lang.StringRESOURCETYPEThe resourcetype property.static java.lang.StringSOURCEThe source property.protected java.lang.StringsupportedLockAn WebDAV property, supportedlock.static java.lang.StringSUPPORTEDLOCKThe supportedlock property.protected static java.lang.StringtempDirForGetDeprecated.The client is responsible for disk I/O.protected booleanthisResourceThe flag to set the status code by propfind.static java.lang.StringTRUEThe true constant string.protected static booleanuseDiskForGetDeprecated.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
Constructors Modifier Constructor Description protectedWebdavResource()The default constructor.WebdavResource(java.lang.String escapedHttpURL)The constructor.WebdavResource(java.lang.String escapedHttpURL, boolean followRedirects)WebdavResource(java.lang.String escapedHttpURL, java.lang.String proxyHost, int proxyPort)The constructor.WebdavResource(java.lang.String escapedHttpURL, java.lang.String proxyHost, int proxyPort, org.apache.commons.httpclient.Credentials proxyCredentials)The constructor.WebdavResource(java.lang.String escapedHttpURL, org.apache.commons.httpclient.Credentials credentials)The constructor.WebdavResource(java.lang.String escapedHttpURL, org.apache.commons.httpclient.Credentials credentials, boolean followRedirects)protectedWebdavResource(org.apache.commons.httpclient.HttpClient client)The constructor.WebdavResource(org.apache.commons.httpclient.HttpURL httpURL)The constructor.WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, boolean followRedirects)The constructor.WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, int depth)The constructor.WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, int depth, boolean followRedirects)The constructor.WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, int action, int depth)The constructor.WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, int action, int depth, boolean followRedirects)The constructor.WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String additionalPath)The constructor.WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String additionalPath, boolean followRedirects)The constructor.WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String proxyHost, int proxyPort)The constructor.WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String proxyHost, int proxyPort, boolean followRedirects)WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String proxyHost, int proxyPort, org.apache.commons.httpclient.Credentials proxyCredentials)The constructor.WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String proxyHost, int proxyPort, org.apache.commons.httpclient.Credentials proxyCredentials, boolean followRedirects)WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, org.apache.commons.httpclient.Credentials credentials, int action, int depth)The constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanabortTransaction()Aborts - i.e.AclPropertyaclfindMethod()Return theAclPropertyfor the current resourceAclPropertyaclfindMethod(java.lang.String path)Return theAclPropertyfor the resource at the given pathbooleanaclMethod(java.lang.String path, Ace[] aces)Updates the resource with a new set of aces.java.util.EnumerationaclReportMethod(java.lang.String path, java.util.Collection properties, int reportType)Execute REPORT method.voidaddRequestHeader(java.lang.String header, java.lang.String value)Add a header in the request sent to the webdav serverbooleanbindMethod(java.lang.String newBinding)Execute the BIND method for this WebdavResource, given an existing path to bind with.booleanbindMethod(java.lang.String existingBinding, java.lang.String newBinding)Execute the BIND method given the new path to bind to an existing path.booleancheckinMethod()Execute the CHECKIN method for this WebdavResource.booleancheckinMethod(java.lang.String path)Execute the CHECKIN method for the given path.booleancheckoutMethod()Execute the CHECKOUT method for this WebdavResource.booleancheckoutMethod(java.lang.String path)Execute the CHECKOUT method for the given path.voidclose()Close the session of this clientbooleancommitTransaction()Commits the transaction started bystartTransaction(String, int)and resets the transaction handle.intcompareTo(java.lang.Object another)Compare to the given another object.intcompareToWebdavResource(WebdavResource another)Compare to the WebdavResource object.booleancopyMethod(java.lang.String destination)Execute the COPY method for the given destination path.booleancopyMethod(java.lang.String source, java.lang.String destination)Execute the COPY method the given source and destination.protected WebdavResourcecreateWebdavResource(org.apache.commons.httpclient.HttpClient client)Create a new WebdavResource object (as a seperate method so that it can be overridden by subclasses.booleandeleteMethod()Execute the DELETE method for this WebdavResource.booleandeleteMethod(java.lang.String path)Execute the DELETE method for the given path.protected WebdavStatediscoverLock(java.lang.String owner, java.lang.String path, WebdavState state)Discover the given owner and locktoken and set the locktokenvoiddiscoverOwnLocks()Discover and refresh lock tokens.voiddiscoverOwnLocks(java.lang.String owner)Discover and refresh lock tokens for a specific owner.protected booleanendTransaction(java.lang.String path, int transactionStatus)booleanequals(java.lang.Object obj)Test the object.intexecuteHttpRequestMethod(org.apache.commons.httpclient.HttpClient client, org.apache.commons.httpclient.HttpMethod method)Execute the http request method.booleanexists()Returns the last known information about the existence of this resource.protected voidgenerateAdditionalHeaders(org.apache.commons.httpclient.HttpMethod method)Add all additionals headers that have been previously registered with addRequestHeader to the methodprotected voidgenerateIfHeader(org.apache.commons.httpclient.HttpMethod method)Generate and add the If header to the specified HTTP method.protected voidgenerateTransactionHeader(org.apache.commons.httpclient.HttpMethod method)Generates and adds the "Transaction" header if this method is part of an externally controlled transaction.java.util.EnumerationgetActiveLockOwners()Get the activelock owners for this resource.java.util.EnumerationgetAllowedMethods()Get the allowed methods, checked by HTTP OPTIONS.WebdavResourcesgetChildResources()Get all resources in this collection with the depth 1.longgetCreationDate()Get the value of DAV property, creationdate.java.util.EnumerationgetDavCapabilities()Get the WebDAV capabilities, checked by HTTP OPTIONS.static intgetDefaultAction()Get the default action.static intgetDefaultDepth()Get the default action.java.lang.StringgetDisplayName()Get the value of DAV property, displayname.booleangetExistence()Returns the last known information about the existence of this resource.booleangetFollowRedirects()Returns the current "follow redirects" flag.longgetGetContentLength()Get the value of DAV property, getcontentlength.java.lang.StringgetGetContentType()Get the value of DAV property, getcontenttype.java.lang.StringgetGetEtag()Get the value of DAV property, getetag.longgetGetLastModified()Get the value of DAV property, getlastmodified.static java.lang.StringgetGetTempDir()Deprecated.The returned directory is not used by the GET method.static booleangetGetUseDisk()Deprecated.This method always returns false.java.lang.StringgetHost()Get the hostname of this WebdavResource.org.apache.commons.httpclient.HttpURLgetHttpURL()Get the HttpURL of this WebdavResource.org.apache.commons.httpclient.HttpURLgetHttpURLExceptForUserInfo()Get the HttpURL except for userinfo.booleangetIsCollection()Get the value of DAV property, iscollectionbooleangetIsHidden()Get the value of DAV property, ishidden.LockDiscoveryPropertygetLockDiscovery()Get the value of DAV property, lockdiscovery.booleangetMethod(java.io.File file)Execute the GET method for this WebdavResource path.booleangetMethod(java.lang.String path, java.io.File file)Execute the GET method for the given path.java.io.InputStreamgetMethodData()Get InputStream for the GET method.java.io.InputStreamgetMethodData(java.lang.String path)Get InputStream for the GET method for the given path.java.lang.StringgetMethodDataAsString()Get data as a String for the GET method.java.lang.StringgetMethodDataAsString(java.lang.String path)Get data as a String for the GET method for the given path.java.lang.StringgetName()Get the name of this WebdavResource.booleangetOverwrite()Get the current value of the overwrite flag for COPY, MOVE, BIND and REBIND.java.lang.StringgetOwner()Get the owner string, as used for locking purposes.java.lang.StringgetPath()Get the path part of this WebdavResource.ResourceTypePropertygetResourceType()Get the value of DAV property, resourcetype.intgetStatusCode()Get the lastest value of the status code by HTTP methods.java.lang.StringgetStatusMessage()Get the lastest value of the status message by HTTP methods.java.lang.StringgetSupportedLock()Get the value of DAV property, supportedlock.java.lang.StringgetTransactionHandle()Returns the transaction handle set bystartTransaction(String, int).booleanheadMethod()Execute the HEAD method for this WebdavResource.booleanheadMethod(java.lang.String path)Execute the HEAD method for the given path.booleanisCollection()Get the value of DAV property, resourcetypebooleanisLocked()Test that this resource is locked.protected booleanisTheClient()Test that the httpURL is the same with the client.booleanlabelMethod(java.lang.String labelname, int type)Execute a LABEL method on the current path, setting the given labelbooleanlabelMethod(java.lang.String path, java.lang.String labelname, int type)Execute a LABEL method on the given path, setting the given labeljava.lang.String[]list()Get an array of pathnames denoting the WebDAV resources in the collection denoted by this pathname.java.util.VectorlistBasic()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.LockDiscoveryPropertylockDiscoveryPropertyFindMethod()Return the LockDiscoveryProperty for the current resourceLockDiscoveryPropertylockDiscoveryPropertyFindMethod(java.lang.String path)Return the LockDiscoveryProperty for the resource at the given pathbooleanlockMethod()Execute the LOCK method for this WebdavResource.booleanlockMethod(java.lang.String path)Execute the LOCK method for the given path.booleanlockMethod(java.lang.String owner, int timeout)Execute the LOCK method for this WebdavResource.booleanlockMethod(java.lang.String owner, short timeout)Deprecated.The timeout value MUST NOT be greater than 2^32-1.booleanlockMethod(java.lang.String path, java.lang.String owner, int timeout)Execute the LOCK method for the given path.booleanlockMethod(java.lang.String path, java.lang.String owner, int timeout, short lockType)Execute the LOCK method for the given path.booleanlockMethod(java.lang.String path, java.lang.String owner, int timeout, short lockType, int depth)Execute the LOCK method for the given path.booleanlockMethod(java.lang.String path, java.lang.String owner, short timeout)Deprecated.The timeout value MUST NOT be greater than 2^32-1.booleanmkcolMethod()Execute the MKCOL method for this WebdavResource.booleanmkcolMethod(java.lang.String path)Execute the MKCOL method for the given path.booleanmkWorkspaceMethod()Execute the MKWORKSPACE method for this WebdavResource.booleanmkWorkspaceMethod(java.lang.String path)Execute the MKCOL method for the given path.booleanmoveMethod(java.lang.String destination)Execute the MOVE method for this WebdavReource.booleanmoveMethod(java.lang.String source, java.lang.String destination)Execute the MOVE method for the given source and destination.booleanoptionsMethod()Execute OPTIONS method for this WebdavResource.booleanoptionsMethod(java.lang.String path)Execute OPTIONS method for the given path.java.util.EnumerationoptionsMethod(java.lang.String path, int type)Execute OPTIONS method for the given path.booleanoptionsMethod(java.lang.String path, java.lang.String aMethod)Execute OPTIONS method for the given path.java.util.EnumerationoptionsMethod(org.apache.commons.httpclient.HttpURL httpURL)Execute OPTIONS method for the given http URL.java.util.EnumerationoptionsMethod(org.apache.commons.httpclient.HttpURL httpURL, int type)Execute OPTIONS method for the given http URL, DELTAVprotected java.util.DateparseDate(java.lang.String dateValue)Parse thejava.util.Datestring for HTTP-date.booleanpollMethod(java.lang.String contentLocation, int subscriptionId)Asks the server whether events for a given subscription are fired.booleanpollMethod(Subscription subscription)Asks the server whether events for a given subscription are fired.PrincipalCollectionSetPropertyprincipalCollectionSetFindMethod()Get thePrincipalCollectionSetPropertyfor the current resource.PrincipalCollectionSetPropertyprincipalCollectionSetFindMethod(java.lang.String path)Get thePrincipalCollectionSetPropertyfor the resource.protected voidprocessProperty(Property property)Process a property, setting various member variables depending on what the property is.java.util.EnumerationpropfindMethod(int depth)Execute PROPFIND method with allprop for this WebdavResource.java.util.EnumerationpropfindMethod(int depth, java.util.Vector properties)Execute PROPFIND method with by propname for this resource.java.util.EnumerationpropfindMethod(java.lang.String propertyName)Execute PROPFIND method for this WebdavResource.java.util.EnumerationpropfindMethod(java.lang.String path, int depth)Execute PROPFIND method with allprop for the given path.java.util.EnumerationpropfindMethod(java.lang.String path, int depth, java.util.Vector properties)Execute PROPFIND method with by propname for the given path.java.util.EnumerationpropfindMethod(java.lang.String path, java.lang.String propertyName)Execute PROPFIND method for the given WebdavResource path.java.util.EnumerationpropfindMethod(java.lang.String path, java.util.Vector properties)Execute PROPFIND method for the given path and properties.java.util.EnumerationpropfindMethod(java.util.Vector properties)Execute PROPFIND method for this WebdavResource.booleanproppatchMethod(java.lang.String propertyName, java.lang.String propertyValue)Deprecated.it could be removed after the major version changesbooleanproppatchMethod(java.lang.String propertyName, java.lang.String propertyValue, boolean action)Execute PROPATCH method for this resource with the given property.booleanproppatchMethod(java.lang.String path, java.lang.String propertyName, java.lang.String propertyValue)Deprecated.it could be removed after the major version changesbooleanproppatchMethod(java.lang.String path, java.lang.String propertyName, java.lang.String propertyValue, boolean action)Execute PROPATCH method for the specified resource with the given property.booleanproppatchMethod(java.lang.String path, java.util.Hashtable properties)Deprecated.it could be removed after the major version changesbooleanproppatchMethod(java.lang.String path, java.util.Hashtable properties, boolean action)Execute PROPATCH method for the specified resource with the given properties.booleanproppatchMethod(java.lang.String path, PropertyName propertyName, java.lang.String propertyValue)Deprecated.it could be removed after the major version changesbooleanproppatchMethod(java.lang.String path, PropertyName propertyName, java.lang.String propertyValue, boolean action)Execute PROPATCH method for the given resource with the given properties.booleanproppatchMethod(java.util.Hashtable properties)Deprecated.it could be removed after the major version changesbooleanproppatchMethod(java.util.Hashtable properties, boolean action)Execute PROPATCH method for this resource with the given properties.booleanproppatchMethod(PropertyName propertyName, java.lang.String propertyValue)Deprecated.it could be removed after the major version changesbooleanproppatchMethod(PropertyName propertyName, java.lang.String propertyValue, boolean action)Execute PROPATCH method for this resource with the given property.booleanputMethod(byte[] data)Execute the PUT method for this resource.booleanputMethod(java.io.File file)Execute the PUT method for this WebdavResource.booleanputMethod(java.io.InputStream is)Execute the PUT method for this resource.booleanputMethod(java.lang.String data)Execute the PUT method for this WebdavResource.booleanputMethod(java.lang.String path, byte[] data)Execute the PUT method for the given path.booleanputMethod(java.lang.String path, java.io.File file)Execute the PUT method for the given path.booleanputMethod(java.lang.String path, java.io.InputStream is)Execute the PUT method for the given path.booleanputMethod(java.lang.String path, java.lang.String data)Execute the PUT method for the given path.booleanputMethod(java.lang.String path, java.net.URL url)Execute the PUT method for the given path from the given url.booleanputMethod(java.net.URL url)Execute the PUT method for this resource from the given url.booleanrebindMethod(java.lang.String newBinding)Execute the Rebind method for this WebdavResource given the new Resource to bind with.booleanrebindMethod(java.lang.String existingBinding, java.lang.String newBinding)Execute the Rebind method given a resource to rebind and the new Resource to bind with.protected voidrefresh()Refresh the properties of this resource without changing the status of the previous commandjava.util.EnumerationreportMethod(org.apache.commons.httpclient.HttpURL httpURL, int depth)Execute the REPORT method.java.util.EnumerationreportMethod(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String sQuery, int depth)java.util.EnumerationreportMethod(org.apache.commons.httpclient.HttpURL httpURL, java.util.Vector properties)java.util.EnumerationreportMethod(org.apache.commons.httpclient.HttpURL httpURL, java.util.Vector properties, int depth)java.util.EnumerationreportMethod(org.apache.commons.httpclient.HttpURL httpURL, java.util.Vector properties, java.util.Vector histUri, int depth)org.apache.commons.httpclient.HttpClientretrieveSessionInstance()Retrieve the current http client for this resource.protected voidsetAllProp(int depth)Set all properties for this resource.protected voidsetBasicProperties(int depth)Sets the basic properties on a resource by indirectly issuing a PROPFIND on the resource.protected voidsetClient()Set the client for this resource.protected voidsetClient(org.apache.commons.httpclient.HttpURL httpURL)Set the client for this resource and the given http URL.voidsetContentType(java.lang.String contentType)Set the content-type to use for this resource, for PUTs.protected voidsetCreationDate(long creationDate)Set the value of DAV property, creationdate.protected voidsetCreationDate(java.lang.String creationDate)Set the value of DAV property, creationdate.static voidsetDefaultAction(int action)Set the default action for this resource.static voidsetDefaultDepth(int depth)Set the default action for this resource.protected voidsetDefaultProperties(int depth)Set the default properties on the resource by indirectly issuing a PROPFIND request for a default set of properties.protected voidsetDisplayName(java.lang.String displayName)Set the value of DAV property, displayname.voidsetEncodeURLs(boolean encodeURLs)Deprecated.No longer has any effect.protected voidsetExistence(boolean exists)Set its existence.voidsetFollowRedirects(boolean value)Sets a flag indicating that redirect responses from the server shall be followed.protected voidsetGetContentLength(long getContentLength)Set the value of DAV property, getcontentlength.protected voidsetGetContentLength(java.lang.String getContentLength)Set the value of DAV property, getcontentlength.protected voidsetGetContentType(java.lang.String getContentType)Set the value of DAV property, getcontenttype.protected voidsetGetEtag(java.lang.String getEtag)Set the value of DAV property, getetag.protected voidsetGetLastModified(long getLastModified)Set the value of DAV property, getlastmodified.protected voidsetGetLastModified(java.lang.String getLastModified)Set the value of DAV property, getlastmodified.static voidsetGetTempDir(java.lang.String tempDir)Deprecated.The given directory will not be used.static voidsetGetUseDisk(boolean useDisk)Deprecated.This method has no effect.voidsetHttpURL(java.lang.String escapedHttpURL)Set the HttpURL of this WebdavResource.voidsetHttpURL(org.apache.commons.httpclient.HttpURL httpURL)Set the HttpURL for this WebdavResource.voidsetHttpURL(org.apache.commons.httpclient.HttpURL httpURL, int depth)Set the HttpURL for this WebdavResource.voidsetHttpURL(org.apache.commons.httpclient.HttpURL httpURL, int action, int depth)Set the HttpURL for this WebdavResource.voidsetHttpURL(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String additionalPath)Set the HttpURL for this WebdavResource.voidsetHttpURL(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String additionalPath, int action)Set the HttpURL for this WebdavResource.voidsetHttpURL(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String additionalPath, int action, int depth)Set the HttpURL for this WebdavResource.protected voidsetIsCollection(boolean isCollection)Set the value of DAV property, iscollectionprotected voidsetIsCollection(java.lang.String isCollection)Set the value of DAV property, iscollectionprotected voidsetIsHidden(boolean isHidden)Set the value of DAV property, ishidden.protected voidsetIsHidden(java.lang.String isHidden)Set the value of DAV property, ishidden.protected voidsetLockDiscovery(LockDiscoveryProperty lockDiscovery)Set the value of DAV property, lockdiscovery.protected voidsetNamedProp(int depth, java.util.Vector propertyNames)Set the named properties for this resource.protected voidsetNameProperties(int depth)Set only the displayname property for this resource.voidsetOverwrite(boolean overwrite)Set the overwrite flag for COPY, MOVE, BIND and REBIND.voidsetPath(java.lang.String path)Set the path part of this WebdavResource.voidsetProperties(int depth)Set the properties for this resource.voidsetProperties(int action, int depth)Set the properties for this resource.protected voidsetResourceType(ResourceTypeProperty resourceType)Set the value of DAV property, resourcetype.protected voidsetStatusCode(int statusCode)Set the lastest value of the status code by HTTP methods.protected voidsetStatusCode(int statusCode, java.lang.String message)Set the lastest value of the status code by HTTP methods.protected voidsetSupportedLock(java.lang.String supportedLock)Set the value of DAV property, supportedlock.voidsetUserInfo(java.lang.String userName, java.lang.String password)Set the userinfo part of this WebdavResource.protected voidsetWebdavProperties(java.util.Enumeration responses)Set WebDAV properties following to the given http URL.booleanstartTransaction(java.lang.String owner, int timeout)Begins a new transaction.booleansubscribeMethod(java.lang.String path, int subscriptionId)Refreshes a subscription.SubscriptionsubscribeMethod(java.lang.String path, java.lang.String notificationType, java.lang.String callback, long notificationDelay, int depth, long lifetime)Subscribes for notifications for modifications of WebDAV resources.booleansubscribeMethod(Subscription subscription)Refreshes a subscription.java.lang.StringtoString()Return the http URL string.booleanunbindMethod()Execute the UNBIND method for this WebdavResource.booleanunbindMethod(java.lang.String binding)Execute the UNBIND method given the resource to Unbind.booleanuncheckoutMethod()Execute the CHECKOUT method for this WebdavResource.booleanuncheckoutMethod(java.lang.String path)Execute the CHECKOUT method for the given path.booleanunlockMethod()Execute the Unlock method for this WebdavResource.booleanunlockMethod(java.lang.String path)Execute the Unlock method for the given path.booleanunlockMethod(java.lang.String path, java.lang.String owner)Execute the Unlock method for the given path.booleanunsubscribeMethod(java.lang.String path, int subscriptionId)Cancels a subscription.booleanunsubscribeMethod(Subscription subscription)Cancels a subscription.booleanupdateMethod(java.lang.String target)Update this resource to the specified targetbooleanupdateMethod(java.lang.String path, java.lang.String target)Update the specified resource to the specified targetbooleanversionControlMethod(java.lang.String path)booleanversionControlMethod(java.lang.String path, java.lang.String target)-
Methods inherited from class org.apache.webdav.lib.WebdavSession
closeSession, closeSession, getSessionInstance, getSessionInstance, setCredentials, setDebug, setProxy, setProxyCredentials
-
-
-
-
Field Detail
-
DISPLAYNAME
public static final java.lang.String DISPLAYNAME
The displayname property.- See Also:
- Constant Field Values
-
GETCONTENTLANGUAGE
public static final java.lang.String GETCONTENTLANGUAGE
The getcontentlanguage property.- See Also:
- Constant Field Values
-
GETCONTENTLENGTH
public static final java.lang.String GETCONTENTLENGTH
The getcontentlength property.- See Also:
- Constant Field Values
-
GETLASTMODIFIED
public static final java.lang.String GETLASTMODIFIED
The getlastmodifed property.- See Also:
- Constant Field Values
-
CREATIONDATE
public static final java.lang.String CREATIONDATE
The creationdate property.- See Also:
- Constant Field Values
-
RESOURCETYPE
public static final java.lang.String RESOURCETYPE
The resourcetype property.- See Also:
- Constant Field Values
-
SOURCE
public static final java.lang.String SOURCE
The source property.- See Also:
- Constant Field Values
-
GETCONTENTTYPE
public static final java.lang.String GETCONTENTTYPE
The getcontenttype property.- See Also:
- Constant Field Values
-
GETETAG
public static final java.lang.String GETETAG
The getetag property.- See Also:
- Constant Field Values
-
ISHIDDEN
public static final java.lang.String ISHIDDEN
The ishidden property.- See Also:
- Constant Field Values
-
ISCOLLECTION
public static final java.lang.String ISCOLLECTION
The iscollection property.- See Also:
- Constant Field Values
-
SUPPORTEDLOCK
public static final java.lang.String SUPPORTEDLOCK
The supportedlock property.- See Also:
- Constant Field Values
-
LOCKDISCOVERY
public static final java.lang.String LOCKDISCOVERY
The lockdiscovery property.- See Also:
- Constant Field Values
-
NOACTION
public static final int NOACTION
No action to find properties for this resource.- See Also:
- Constant Field Values
-
NAME
public static final int NAME
The action setting only the displayname for this resource.- See Also:
- Constant Field Values
-
BASIC
public static final int BASIC
The action setting the basic properties for this resource.- See Also:
- Constant Field Values
-
DEFAULT
public static final int DEFAULT
The action setting the default DAV properties for this resource.- See Also:
- Constant Field Values
-
ALL
public static final int ALL
The action setting the all properties for this resource.- See Also:
- Constant Field Values
-
OPTIONS_WORKSPACE
public static final int OPTIONS_WORKSPACE
- See Also:
- Constant Field Values
-
OPTIONS_VERSION_HISTORY
public static final int OPTIONS_VERSION_HISTORY
- See Also:
- Constant Field Values
-
LABEL_SET
public static final int LABEL_SET
- See Also:
- Constant Field Values
-
LABEL_REMOVE
public static final int LABEL_REMOVE
- See Also:
- Constant Field Values
-
LABEL_ADD
public static final int LABEL_ADD
- See Also:
- Constant Field Values
-
defaultOwner
public static final java.lang.String defaultOwner
Owner information for locking and unlocking.- See Also:
- Constant Field Values
-
TRUE
public static final java.lang.String TRUE
The true constant string.- See Also:
- Constant Field Values
-
FALSE
public static final java.lang.String FALSE
The false constant string.- See Also:
- Constant Field Values
-
formats
public static final java.text.SimpleDateFormat[] formats
Date formats using for Date parsing.
-
gmtZone
protected static final java.util.TimeZone gmtZone
GMT timezone.
-
httpURL
protected org.apache.commons.httpclient.HttpURL httpURL
The HttpURL to represent a WebDAV resource.
-
childResources
protected WebdavResources childResources
Table of the hrefs gotten in a collection.
-
defaultAction
protected static int defaultAction
The default action to find properties.
-
defaultDepth
protected static int defaultDepth
The default depth for WebDAV methods.
-
tempDirForGet
protected static java.lang.String tempDirForGet
Deprecated.The client is responsible for disk I/O.The default temporary directory for the GET method.
-
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.
-
thisResource
protected boolean thisResource
The flag to set the status code by propfind.
-
allowedMethods
protected java.util.Enumeration allowedMethods
The allowed HTTP methods.
-
davCapabilities
protected java.util.Enumeration davCapabilities
The capabilities of the WebDAV server.
-
exists
protected boolean exists
An WebdavResource flag to check its existence;
-
overwrite
protected boolean overwrite
An WebdavResource flag to check overwriting;
-
latestStatusCode
protected int latestStatusCode
An status code performed by HTTP methods at the most recent.
-
latestStatusMessage
protected java.lang.String latestStatusMessage
An status message performed by HTTP methods at the most recent.
-
displayName
protected java.lang.String displayName
An WebDAV property, displayname.
-
getContentLength
protected long getContentLength
An WebDAV property, getcontentlength.
-
getContentType
protected java.lang.String getContentType
An WebDAV property, getcontenttype.
-
resourceType
protected ResourceTypeProperty resourceType
An WebDAV property, resourcetype.
-
getLastModified
protected long getLastModified
An WebDAV property, getlastmodified.
-
creationDate
protected long creationDate
An WebDAV property, creationdate.
-
getEtag
protected java.lang.String getEtag
An WebDAV property, getetag.
-
owner
protected java.lang.String owner
Owner information for locking and unlocking.
-
isHidden
protected boolean isHidden
An WebDAV property, ishidden.
-
isCollection
protected boolean isCollection
An WebDAV property, iscollection.
-
supportedLock
protected java.lang.String supportedLock
An WebDAV property, supportedlock.
-
lockDiscovery
protected LockDiscoveryProperty lockDiscovery
An WebDAV property, lockdiscovery.
-
followRedirects
protected boolean followRedirects
-
headers
protected java.util.Map headers
Map of additional headers
-
-
Constructor Detail
-
WebdavResource
protected WebdavResource()
The default constructor.
-
WebdavResource
protected WebdavResource(org.apache.commons.httpclient.HttpClient client)
The constructor.
-
WebdavResource
public WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, org.apache.commons.httpclient.Credentials credentials, int action, int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe 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.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
WebdavResource
public WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, int action, int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe constructor.- Parameters:
httpURL- The specified http URL.action- The action to set properties of this resource.depth- The depth to find properties.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
WebdavResource
public WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, int action, int depth, boolean followRedirects) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe 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- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
WebdavResource
public WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe constructor.- Parameters:
httpURL- The specified http URL.depth- The depth to find properties.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
WebdavResource
public WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, int depth, boolean followRedirects) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe constructor.- Parameters:
httpURL- The specified http URL.depth- The depth to find properties.followRedirects- Shall redirects be followed automatically.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
WebdavResource
public WebdavResource(org.apache.commons.httpclient.HttpURL httpURL) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe constructor.- Parameters:
httpURL- The specified http URL.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
WebdavResource
public WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, boolean followRedirects) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe constructor.- Parameters:
httpURL- The specified http URL.followRedirects- shall redirects from the server be accepted- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
WebdavResource
public WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String proxyHost, int proxyPort) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe constructor.- Parameters:
httpURL- The specified http URL.proxyHost- The hostname of the proxy to use.proxyPort- The port number of the proxy to use.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
WebdavResource
public WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String proxyHost, int proxyPort, boolean followRedirects) throws org.apache.commons.httpclient.HttpException, java.io.IOException- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
WebdavResource
public WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String proxyHost, int proxyPort, org.apache.commons.httpclient.Credentials proxyCredentials) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe 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.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
WebdavResource
public WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String proxyHost, int proxyPort, org.apache.commons.httpclient.Credentials proxyCredentials, boolean followRedirects) throws org.apache.commons.httpclient.HttpException, java.io.IOException- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
WebdavResource
public WebdavResource(java.lang.String escapedHttpURL) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe constructor. It must be put an escaped http URL as an argument.- Parameters:
escapedHttpURL- The escaped http URL string.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
WebdavResource
public WebdavResource(java.lang.String escapedHttpURL, boolean followRedirects) throws org.apache.commons.httpclient.HttpException, java.io.IOException- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
WebdavResource
public WebdavResource(java.lang.String escapedHttpURL, org.apache.commons.httpclient.Credentials credentials) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe 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.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
WebdavResource
public WebdavResource(java.lang.String escapedHttpURL, org.apache.commons.httpclient.Credentials credentials, boolean followRedirects) throws org.apache.commons.httpclient.HttpException, java.io.IOException- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
WebdavResource
public WebdavResource(java.lang.String escapedHttpURL, java.lang.String proxyHost, int proxyPort) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe 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.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
WebdavResource
public WebdavResource(java.lang.String escapedHttpURL, java.lang.String proxyHost, int proxyPort, org.apache.commons.httpclient.Credentials proxyCredentials) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe 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.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
WebdavResource
public WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String additionalPath) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe constructor.- Parameters:
httpURL- The http URL.additionalPath- The added relative path.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
WebdavResource
public WebdavResource(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String additionalPath, boolean followRedirects) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionThe constructor.- Parameters:
httpURL- The http URL.additionalPath- The added relative path.followRedirects- shall redirects be accepted- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
-
Method Detail
-
generateTransactionHeader
protected void generateTransactionHeader(org.apache.commons.httpclient.HttpMethod method)
Generates and adds the "Transaction" header if this method is part of an externally controlled transaction.
-
generateIfHeader
protected void generateIfHeader(org.apache.commons.httpclient.HttpMethod method)
Generate and add the If header to the specified HTTP method.
-
generateAdditionalHeaders
protected void generateAdditionalHeaders(org.apache.commons.httpclient.HttpMethod method)
Add all additionals headers that have been previously registered with addRequestHeader to the method
-
parseDate
protected java.util.Date parseDate(java.lang.String dateValue)
Parse thejava.util.Datestring for HTTP-date.- Returns:
- The parsed date.
-
setNameProperties
protected void setNameProperties(int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet only the displayname property for this resource.- Parameters:
depth- The depth to find properties.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
setBasicProperties
protected void setBasicProperties(int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSets 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.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
setDefaultProperties
protected void setDefaultProperties(int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet 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.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
setNamedProp
protected void setNamedProp(int depth, java.util.Vector propertyNames) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet the named properties for this resource.- Parameters:
depth- The depth.propertyNames- The property-names.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
setAllProp
protected void setAllProp(int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet all properties for this resource.- Parameters:
depth- The depth- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
setWebdavProperties
protected void setWebdavProperties(java.util.Enumeration responses) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet WebDAV properties following to the given http URL. This method is fundamental for getting information of a collection.- Parameters:
responses- An enumeration overResponseEntityitems, one for each resource for which information was returned via PROPFIND.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- The socket error with a server.
-
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
-
getDefaultAction
public static int getDefaultAction()
Get the default action.- Returns:
- 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.
-
getDefaultDepth
public static int getDefaultDepth()
Get the default action.- Returns:
- The depth.
-
setGetTempDir
public static void setGetTempDir(java.lang.String tempDir)
Deprecated.The given directory will not be used.Get the default temporary directory for the GET method.- Parameters:
tempDir- The temporary directory.
-
getGetTempDir
public static java.lang.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.
-
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.
-
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.
-
setFollowRedirects
public void setFollowRedirects(boolean value)
Sets a flag indicating that redirect responses from the server shall be followed.
-
getFollowRedirects
public boolean getFollowRedirects()
Returns the current "follow redirects" flag.- See Also:
setFollowRedirects(boolean)
-
isTheClient
protected boolean isTheClient() throws org.apache.commons.httpclient.URIExceptionTest that the httpURL is the same with the client.- Returns:
- true if the given httpURL is the client for this resource.
- Throws:
org.apache.commons.httpclient.URIException
-
setClient
protected void setClient() throws java.io.IOExceptionSet the client for this resource.- Throws:
java.io.IOException
-
setClient
protected void setClient(org.apache.commons.httpclient.HttpURL httpURL) throws java.io.IOExceptionSet the client for this resource and the given http URL.- Parameters:
httpURL- The http URL.- Throws:
java.io.IOException
-
setHttpURL
public void setHttpURL(org.apache.commons.httpclient.HttpURL httpURL, int action, int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet 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.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setHttpURL(java.lang.String),setUserInfo(java.lang.String, java.lang.String),setPath(java.lang.String),setDefaultAction(int)
-
setHttpURL
public void setHttpURL(org.apache.commons.httpclient.HttpURL httpURL, int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet the HttpURL for this WebdavResource.- Parameters:
httpURL- the specified HttpURL.depth- The depth to find properties.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setHttpURL(java.lang.String),setUserInfo(java.lang.String, java.lang.String),setPath(java.lang.String)
-
setHttpURL
public void setHttpURL(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String additionalPath, int action, int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet 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.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setHttpURL(java.lang.String),setUserInfo(java.lang.String, java.lang.String),setPath(java.lang.String),setDefaultAction(int)
-
setHttpURL
public void setHttpURL(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String additionalPath, int action) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet 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.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setHttpURL(java.lang.String),setUserInfo(java.lang.String, java.lang.String),setPath(java.lang.String),setDefaultAction(int)
-
setHttpURL
public void setHttpURL(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String additionalPath) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet the HttpURL for this WebdavResource.- Parameters:
httpURL- The specified HttpURL.additionalPath- The added relative path.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setHttpURL(java.lang.String),setUserInfo(java.lang.String, java.lang.String),setPath(java.lang.String)
-
setHttpURL
public void setHttpURL(org.apache.commons.httpclient.HttpURL httpURL) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet the HttpURL for this WebdavResource.- Parameters:
httpURL- the specified HttpURL.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setHttpURL(java.lang.String),setUserInfo(java.lang.String, java.lang.String),setPath(java.lang.String)
-
setHttpURL
public void setHttpURL(java.lang.String escapedHttpURL) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet the HttpURL of this WebdavResource. It must be put an escaped http URL as an argument.- Parameters:
escapedHttpURL- The escaped http URL string.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setHttpURL(HttpURL),setUserInfo(java.lang.String, java.lang.String),setPath(java.lang.String)
-
getHttpURL
public org.apache.commons.httpclient.HttpURL getHttpURL()
Get the HttpURL of this WebdavResource.- Returns:
- httpURL the http URL.
-
getHttpURLExceptForUserInfo
public org.apache.commons.httpclient.HttpURL getHttpURLExceptForUserInfo() throws org.apache.commons.httpclient.URIExceptionGet the HttpURL except for userinfo.- Returns:
- httpURL the http URL.
- Throws:
org.apache.commons.httpclient.URIException
-
setPath
public void setPath(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet the path part of this WebdavResource.- Parameters:
path- the specified path.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setHttpURL(HttpURL),setHttpURL(java.lang.String),setUserInfo(java.lang.String, java.lang.String)
-
getPath
public java.lang.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:
URI.getPath(),setPath(java.lang.String)
-
getName
public java.lang.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.
- See Also:
URI.getName()
-
getHost
public java.lang.String getHost() throws org.apache.commons.httpclient.URIExceptionGet the hostname of this WebdavResource.- Returns:
- the hostname.
- Throws:
org.apache.commons.httpclient.URIException
-
setUserInfo
public void setUserInfo(java.lang.String userName, java.lang.String password) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet the userinfo part of this WebdavResource.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setHttpURL(HttpURL),setHttpURL(java.lang.String),setPath(java.lang.String)
-
addRequestHeader
public void addRequestHeader(java.lang.String header, java.lang.String value)Add a header in the request sent to the webdav server- Parameters:
header- Header namevalue- Value
-
getDisplayName
public java.lang.String getDisplayName()
Get the value of DAV property, displayname.- Returns:
- The displayname string.
-
setDisplayName
protected void setDisplayName(java.lang.String displayName)
Set the value of DAV property, displayname.- Parameters:
displayName- The displayname string.
-
getGetContentLength
public long getGetContentLength()
Get the value of DAV property, getcontentlength.- Returns:
- The getcontentlength value.
-
setGetContentLength
protected void setGetContentLength(long getContentLength)
Set the value of DAV property, getcontentlength.- Parameters:
getContentLength- The getcontentlength value.
-
setGetContentLength
protected void setGetContentLength(java.lang.String getContentLength)
Set the value of DAV property, getcontentlength.- Parameters:
getContentLength- The getcontentlength value.
-
getResourceType
public ResourceTypeProperty getResourceType()
Get the value of DAV property, resourcetype.- Returns:
- The resourcetype property.
- See Also:
isCollection()
-
setResourceType
protected void setResourceType(ResourceTypeProperty resourceType)
Set the value of DAV property, resourcetype.- Parameters:
resourceType- The resourcetype property.
-
isCollection
public boolean isCollection()
Get the value of DAV property, resourcetype- Returns:
- The resourcetype string.
- See Also:
getResourceType(),getIsCollection()
-
getGetContentType
public java.lang.String getGetContentType()
Get the value of DAV property, getcontenttype.- Returns:
- The getcontenttype string.
-
setGetContentType
protected void setGetContentType(java.lang.String getContentType)
Set the value of DAV property, getcontenttype.- Parameters:
getContentType- The getcontenttype string.
-
setContentType
public void setContentType(java.lang.String contentType)
Set the content-type to use for this resource, for PUTs.- Parameters:
contentType- The content-type string.
-
getGetLastModified
public long getGetLastModified()
Get the value of DAV property, getlastmodified.- Returns:
- 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)
-
setGetLastModified
protected void setGetLastModified(java.lang.String getLastModified)
Set the value of DAV property, getlastmodified.- Parameters:
getLastModified- The getlastmodified value.- See Also:
setGetLastModified(long)
-
getCreationDate
public long getCreationDate()
Get the value of DAV property, creationdate.- Returns:
- The creationdate string.
-
setCreationDate
protected void setCreationDate(long creationDate)
Set the value of DAV property, creationdate.- Parameters:
creationDate- The creationdate string.
-
setCreationDate
protected void setCreationDate(java.lang.String creationDate)
Set the value of DAV property, creationdate.- Parameters:
creationDate- The creationdate string.
-
getGetEtag
public java.lang.String getGetEtag()
Get the value of DAV property, getetag.- Returns:
- The getetag string.
-
setGetEtag
protected void setGetEtag(java.lang.String getEtag)
Set the value of DAV property, getetag.- Parameters:
getEtag- The getetag string.
-
getOwner
public java.lang.String getOwner()
Get the owner string, as used for locking purposes.
-
getSupportedLock
public java.lang.String getSupportedLock()
Get the value of DAV property, supportedlock.- Returns:
- The supportedlock string.
-
setSupportedLock
protected void setSupportedLock(java.lang.String supportedLock)
Set the value of DAV property, supportedlock.- Parameters:
supportedLock- The supportedlock string.
-
getLockDiscovery
public LockDiscoveryProperty getLockDiscovery()
Get the value of DAV property, lockdiscovery.- Returns:
- The lockdiscovery property.
-
setLockDiscovery
protected void setLockDiscovery(LockDiscoveryProperty lockDiscovery)
Set the value of DAV property, lockdiscovery.- Parameters:
lockDiscovery- The lockdiscovery property.
-
getActiveLockOwners
public java.util.Enumeration getActiveLockOwners()
Get the activelock owners for this resource.- Returns:
- An enumeration of owners.
-
isLocked
public boolean isLocked()
Test that this resource is locked.- Returns:
- true if it's locked.
-
getIsHidden
public boolean getIsHidden()
Get the value of DAV property, ishidden.- Returns:
- true if it is hidden, otherwise false.
-
setIsHidden
protected void setIsHidden(boolean isHidden)
Set the value of DAV property, ishidden.- Parameters:
isHidden-
-
setIsHidden
protected void setIsHidden(java.lang.String isHidden)
Set the value of DAV property, ishidden.- Parameters:
isHidden-
-
getIsCollection
public boolean getIsCollection()
Get the value of DAV property, iscollection- Returns:
- true if it is collection, otherwise false.
- See Also:
isCollection()
-
setIsCollection
protected void setIsCollection(boolean isCollection)
Set the value of DAV property, iscollection- Parameters:
isCollection-
-
setIsCollection
protected void setIsCollection(java.lang.String isCollection)
Set the value of DAV property, iscollection- Parameters:
isCollection-
-
setProperties
public void setProperties(int action, int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet the properties for this resource.- Parameters:
action- The action to find properties for this resource.depth- the depth to which properties shall be found- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setDefaultAction(int)
-
setProperties
public void setProperties(int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionSet the properties for this resource.- Parameters:
depth- the depth to which properties shall be found- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
refresh
protected void refresh() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionRefresh the properties of this resource without changing the status of the previous command- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
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. - See Also:
getExistence(),setProperties(int, int)
-
setExistence
protected void setExistence(boolean exists)
Set its existence.- Parameters:
exists- The boolean value to be set for its existence.
-
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. - See Also:
setProperties(int, int)
-
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- See Also:
getOverwrite()
-
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.
- See Also:
setOverwrite(boolean)
-
close
public void close() throws java.io.IOExceptionClose the session of this client- Throws:
java.io.IOException
-
getStatusMessage
public java.lang.String getStatusMessage()
Get the lastest value of the status message by HTTP methods.- Returns:
- The http status string.
-
getStatusCode
public int getStatusCode()
Get the lastest value of the status code by HTTP methods.- Returns:
- The http status code.
-
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, java.lang.String message)Set the lastest value of the status code by HTTP methods.- Parameters:
statusCode- the HTTP status code.message- the additional message.
-
getAllowedMethods
public java.util.Enumeration getAllowedMethods()
Get the allowed methods, checked by HTTP OPTIONS.- Returns:
- the allowed HTTP methods.
- See Also:
optionsMethod(java.lang.String)
-
getDavCapabilities
public java.util.Enumeration getDavCapabilities()
Get the WebDAV capabilities, checked by HTTP OPTIONS.- Returns:
- the WebDAV capabilities.
- See Also:
optionsMethod(java.lang.String)
-
getChildResources
public WebdavResources getChildResources() throws org.apache.commons.httpclient.HttpException, java.io.IOException
Get all resources in this collection with the depth 1.- Returns:
- resources in this collection with the depth 1.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
listWebdavResources
public WebdavResource[] listWebdavResources() throws org.apache.commons.httpclient.HttpException, java.io.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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
list
public java.lang.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 java.util.Vector listBasic() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionGet 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
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.- Throws:
MalformedURLExceptionjava.io.IOException
-
retrieveSessionInstance
public org.apache.commons.httpclient.HttpClient retrieveSessionInstance() throws java.io.IOExceptionRetrieve the current http client for this resource.- Returns:
- The http client.
- Throws:
java.io.IOException- See Also:
executeHttpRequestMethod(HttpClient, HttpMethod)
-
executeHttpRequestMethod
public int executeHttpRequestMethod(org.apache.commons.httpclient.HttpClient client, org.apache.commons.httpclient.HttpMethod method) throws java.io.IOException, org.apache.commons.httpclient.HttpExceptionExecute the http request method. And get its status code.- Parameters:
client- The http client.method- The http method.- Returns:
- The status code.
- Throws:
java.io.IOExceptionorg.apache.commons.httpclient.HttpException- See Also:
retrieveSessionInstance()
-
aclMethod
public boolean aclMethod(java.lang.String path, Ace[] aces) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionUpdates the resource with a new set of aces.- Parameters:
path- the server relative path of the resource to which the given ACEs shall be appliedaces- the ACEs to apply- Returns:
- true if the method succeeded
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
aclfindMethod
public AclProperty aclfindMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOException
Return theAclPropertyfor the current resource- Returns:
- acl property, null if the server doesn't respond with
AclProperty - Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
aclfindMethod
public AclProperty aclfindMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOException
Return theAclPropertyfor 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 - Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
principalCollectionSetFindMethod
public PrincipalCollectionSetProperty principalCollectionSetFindMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOException
Get thePrincipalCollectionSetPropertyfor the current resource.- Returns:
- principal collection set Property, null if the server doesn't
respond with a
PrincipalCollectionSetProperty - Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
principalCollectionSetFindMethod
public PrincipalCollectionSetProperty principalCollectionSetFindMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOException
Get thePrincipalCollectionSetPropertyfor 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 - Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
lockDiscoveryPropertyFindMethod
public LockDiscoveryProperty lockDiscoveryPropertyFindMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOException
Return the LockDiscoveryProperty for the current resource- Returns:
- null if the server doesn't respond with a LockDiscoveryProperty
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
lockDiscoveryPropertyFindMethod
public LockDiscoveryProperty lockDiscoveryPropertyFindMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.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
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
getMethodData
public java.io.InputStream getMethodData() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionGet InputStream for the GET method.- Returns:
- InputStream
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
getMethodData
public java.io.InputStream getMethodData(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionGet InputStream for the GET method for the given path.- Parameters:
path- the server relative path of the resource to get- Returns:
- InputStream
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
getMethodDataAsString
public java.lang.String getMethodDataAsString() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionGet data as a String for the GET method.- Returns:
- the contents of this resource as a string
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
getMethodDataAsString
public java.lang.String getMethodDataAsString(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionGet 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
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
getMethod
public boolean getMethod(java.io.File file) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the GET method for this WebdavResource path.- Parameters:
file- The local file.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
getMethod
public boolean getMethod(java.lang.String path, java.io.File file) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the GET method for the given path.- Parameters:
path- the server relative path of the resource to getfile- The local file.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
putMethod
public boolean putMethod(byte[] data) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the PUT method for this resource.- Parameters:
data- The byte array.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
putMethod
public boolean putMethod(java.lang.String path, byte[] data) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the PUT method for the given path.- Parameters:
path- the server relative path to put the datadata- The byte array.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
putMethod
public boolean putMethod(java.io.InputStream is) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the PUT method for this resource.- Parameters:
is- The input stream.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
putMethod
public boolean putMethod(java.lang.String path, java.io.InputStream is) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the PUT method for the given path.- Parameters:
path- the server relative path to put the datais- The input stream.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
putMethod
public boolean putMethod(java.lang.String data) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the PUT method for this WebdavResource.- Parameters:
data- String data to send.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
putMethod
public boolean putMethod(java.lang.String path, java.lang.String data) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the PUT method for the given path.- Parameters:
path- the server relative path to put the datadata- String to send.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
putMethod
public boolean putMethod(java.io.File file) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the PUT method for this WebdavResource.- Parameters:
file- the filename to get on local.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
putMethod
public boolean putMethod(java.lang.String path, java.io.File file) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the PUT method for the given path.- Parameters:
path- the server relative path to put the given filefile- the filename to get on local.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
putMethod
public boolean putMethod(java.net.URL url) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
putMethod
public boolean putMethod(java.lang.String path, java.net.URL url) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the PUT method for the given path from the given url.- Parameters:
path- the server relative path to put the dataurl- The URL to get a resource.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
optionsMethod
public boolean optionsMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute OPTIONS method for this WebdavResource.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
optionsMethod
public boolean optionsMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute OPTIONS method for the given path.- Parameters:
path- the server relative path of the resource to request- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
getAllowedMethods()
-
optionsMethod
public boolean optionsMethod(java.lang.String path, java.lang.String aMethod) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute OPTIONS method for the given path.- Parameters:
path- the server relative path to send the requestaMethod- a method to check it's supported.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
optionsMethod
public java.util.Enumeration optionsMethod(org.apache.commons.httpclient.HttpURL httpURL) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute OPTIONS method for the given http URL.- Parameters:
httpURL- the http URL.- Returns:
- the allowed methods and capabilities.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
optionsMethod
public java.util.Enumeration optionsMethod(org.apache.commons.httpclient.HttpURL httpURL, int type) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute OPTIONS method for the given http URL, DELTAV- Parameters:
httpURL- the http URL.- Returns:
- the allowed methods and capabilities.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
optionsMethod
public java.util.Enumeration optionsMethod(java.lang.String path, int type) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute OPTIONS method for the given path.- Parameters:
path- the server relative path of the resource to request- Returns:
- the allowed methods and capabilities.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
getAllowedMethods()
-
labelMethod
public boolean labelMethod(java.lang.String labelname, int type) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute a LABEL method on the current path, setting the given label- Parameters:
labelname- the label to settype- the type of action. One of:- LABEL_ADD
- LABEL_REMOVE
- LABEL_SET
- Returns:
- true if the method succeeded
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
labelMethod
public boolean labelMethod(java.lang.String path, java.lang.String labelname, int type) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute a LABEL method on the given path, setting the given label- Parameters:
path- the server relative path of the resource to act onlabelname- the label to settype- the type of action. One of:- LABEL_ADD
- LABEL_REMOVE
- LABEL_SET
- Returns:
- true if the method succeeded
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
reportMethod
public java.util.Enumeration reportMethod(org.apache.commons.httpclient.HttpURL httpURL, int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the REPORT method.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
reportMethod
public java.util.Enumeration reportMethod(org.apache.commons.httpclient.HttpURL httpURL, java.util.Vector properties) throws org.apache.commons.httpclient.HttpException, java.io.IOException- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
reportMethod
public java.util.Enumeration reportMethod(org.apache.commons.httpclient.HttpURL httpURL, java.util.Vector properties, int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOException- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
reportMethod
public java.util.Enumeration reportMethod(org.apache.commons.httpclient.HttpURL httpURL, java.util.Vector properties, java.util.Vector histUri, int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOException- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
reportMethod
public java.util.Enumeration reportMethod(org.apache.commons.httpclient.HttpURL httpURL, java.lang.String sQuery, int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOException- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
propfindMethod
public java.util.Enumeration propfindMethod(int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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 - Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
propfindMethod
public java.util.Enumeration propfindMethod(java.lang.String path, int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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 requestdepth-- Returns:
- an enumeration of
ResponseEntity - Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
propfindMethod
public java.util.Enumeration propfindMethod(int depth, java.util.Vector properties) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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 - Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
propfindMethod
public java.util.Enumeration propfindMethod(java.lang.String path, int depth, java.util.Vector properties) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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 requestdepth- The depth.properties- The named properties.- Returns:
- an enumeration of
ResponseEntity - Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
propfindMethod
public java.util.Enumeration propfindMethod(java.lang.String propertyName) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
propfindMethod
public java.util.Enumeration propfindMethod(java.lang.String path, java.lang.String propertyName) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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 requestpropertyName- the WebDAV property to find.- Returns:
- Enumeration list of WebDAV properties on a resource.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
propfindMethod
public java.util.Enumeration propfindMethod(java.util.Vector properties) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
propfindMethod
public java.util.Enumeration propfindMethod(java.lang.String path, java.util.Vector properties) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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 requestproperties- the WebDAV properties to find.- Returns:
- Enumeration list of WebDAV properties on a resource.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
proppatchMethod
public boolean proppatchMethod(java.lang.String propertyName, java.lang.String propertyValue) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionDeprecated.it could be removed after the major version changesExecute PROPATCH method for this WebdavResource.- Parameters:
propertyName- the name of the property to setpropertyValue- the value of the property to set- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
proppatchMethod
public boolean proppatchMethod(java.lang.String propertyName, java.lang.String propertyValue, boolean action) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
proppatchMethod
public boolean proppatchMethod(PropertyName propertyName, java.lang.String propertyValue) throws org.apache.commons.httpclient.HttpException, java.io.IOException
Deprecated.it could be removed after the major version changesExecute PROPATCH method for this WebdavResource.- Parameters:
propertyName- the name of the property to setpropertyValue- the value of the property to set- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
proppatchMethod
public boolean proppatchMethod(PropertyName propertyName, java.lang.String propertyValue, boolean action) throws org.apache.commons.httpclient.HttpException, java.io.IOException
Execute PROPATCH method for this resource with the given property.- Parameters:
propertyName- the name of the property to setpropertyValue- 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
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
proppatchMethod
public boolean proppatchMethod(java.lang.String path, java.lang.String propertyName, java.lang.String propertyValue) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionDeprecated.it could be removed after the major version changesExecute PROPATCH method for the given WebdavResource.- Parameters:
path- the server relative path of the resource to act onpropertyName- the property name in "DAV:" namespacepropertyValue- the property value string- Returns:
- true if the method is succeeded
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
proppatchMethod
public boolean proppatchMethod(java.lang.String path, java.lang.String propertyName, java.lang.String propertyValue, boolean action) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute PROPATCH method for the specified resource with the given property.- Parameters:
path- the server relative path of the resource to act onpropertyName- 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
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
proppatchMethod
public boolean proppatchMethod(java.lang.String path, PropertyName propertyName, java.lang.String propertyValue) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionDeprecated.it could be removed after the major version changesExecute PROPATCH method for the given WebdavResource.- Parameters:
path- the server relative path of the resource to act onpropertyName- the property name.propertyValue- the property value.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
proppatchMethod
public boolean proppatchMethod(java.lang.String path, PropertyName propertyName, java.lang.String propertyValue, boolean action) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute PROPATCH method for the given resource with the given properties.- Parameters:
path- the server relative path of the resource to act onpropertyName- the property namepropertyValue- 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
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
proppatchMethod
public boolean proppatchMethod(java.util.Hashtable properties) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionDeprecated.it could be removed after the major version changesExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
proppatchMethod
public boolean proppatchMethod(java.util.Hashtable properties, boolean action) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute PROPATCH method for this resource with the given properties.- Parameters:
properties- the name(=StringorPropertyNameand 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
proppatchMethod
public boolean proppatchMethod(java.lang.String path, java.util.Hashtable properties) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionDeprecated.it could be removed after the major version changesExecute PROPATCH method for the given WebdavResource.- Parameters:
path- the server relative path of the resource to act onproperties- name and value pairs to set (name can be a String or PropertyName)- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
proppatchMethod
public boolean proppatchMethod(java.lang.String path, java.util.Hashtable properties, boolean action) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute PROPATCH method for the specified resource with the given properties.- Parameters:
path- the server relative path of the resource to act onproperties- the name(=StringorPropertyNameand 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
headMethod
public boolean headMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the HEAD method for this WebdavResource.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
headMethod
public boolean headMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
deleteMethod
public boolean deleteMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the DELETE method for this WebdavResource.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
deleteMethod
public boolean deleteMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
moveMethod
public boolean moveMethod(java.lang.String destination) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
moveMethod
public boolean moveMethod(java.lang.String source, java.lang.String destination) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the MOVE method for the given source and destination.- Parameters:
source- the source resource as a server relativ pathdestination- the destination to move to as a server relative path- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
copyMethod
public boolean copyMethod(java.lang.String destination) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the COPY method for the given destination path.- Parameters:
destination- the destination as a server relative path- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
copyMethod
public boolean copyMethod(java.lang.String source, java.lang.String destination) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the COPY method the given source and destination.- Parameters:
source- the source resource as a server relative pathdestination- the destination as a server relative path- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
mkcolMethod
public boolean mkcolMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the MKCOL method for this WebdavResource.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
mkcolMethod
public boolean mkcolMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
lockMethod
public boolean lockMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
lockMethod
public boolean lockMethod(java.lang.String owner, int timeout) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
lockMethod
public boolean lockMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
lockMethod
public boolean lockMethod(java.lang.String path, java.lang.String owner, int timeout) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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 lockowner- The owner string.timeout- the timeout value.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
lockMethod
public boolean lockMethod(java.lang.String path, java.lang.String owner, int timeout, short lockType) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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 lockowner- The owner string.timeout- the timeout value.locktype- , the scope of lock.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
lockMethod
public boolean lockMethod(java.lang.String path, java.lang.String owner, int timeout, short lockType, int depth) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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 lockowner- The owner string.timeout- the timeout value.locktype- , the scope of lock.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
lockMethod
public boolean lockMethod(java.lang.String owner, short timeout) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionDeprecated.The timeout value MUST NOT be greater than 2^32-1.Execute the LOCK method for this WebdavResource.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
LockMethod
-
lockMethod
public boolean lockMethod(java.lang.String path, java.lang.String owner, short timeout) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionDeprecated.The timeout value MUST NOT be greater than 2^32-1.Execute the LOCK method for the given path.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
LockMethod
-
startTransaction
public boolean startTransaction(java.lang.String owner, int timeout) throws java.io.IOExceptionBegins a new transaction. The transaction handle returned by the WebDAV server will be remembered and included as a header of subsequent requests until eithercommitTransaction()orabortTransaction()are called. You can retrieve it usinggetTransactionHandle().- Parameters:
owner- the owner of this transactiontimeout- timeout in milleseconds- Returns:
trueif the transaction has been successfully started,falseotherwise- Throws:
java.io.IOException- if anything goes wrong- See Also:
commitTransaction(),abortTransaction(),getTransactionHandle()
-
getTransactionHandle
public java.lang.String getTransactionHandle() throws java.io.IOExceptionReturns the transaction handle set bystartTransaction(String, int).- Returns:
- the current transaction handle or
nullif the client does not operate inside a transaction - Throws:
java.io.IOException- if anything goes wrong- See Also:
startTransaction(String, int)
-
commitTransaction
public boolean commitTransaction() throws java.io.IOExceptionCommits the transaction started bystartTransaction(String, int)and resets the transaction handle.- Returns:
trueif the transaction has been successfully committed,falseotherwise- Throws:
java.io.IOException- if anything goes wrong- See Also:
startTransaction(String, int),abortTransaction(),getTransactionHandle()
-
abortTransaction
public boolean abortTransaction() throws java.io.IOExceptionAborts - i.e. rolls back all changes of - the transaction started bystartTransaction(String, int)and resets the transaction handle.- Returns:
trueif the transaction has been successfully committed,falseotherwise- Throws:
java.io.IOException- if anything goes wrong- See Also:
startTransaction(String, int),abortTransaction(),getTransactionHandle()
-
endTransaction
protected boolean endTransaction(java.lang.String path, int transactionStatus) throws java.io.IOException- Throws:
java.io.IOException
-
unlockMethod
public boolean unlockMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the Unlock method for this WebdavResource.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
unlockMethod
public boolean unlockMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
unlockMethod
public boolean unlockMethod(java.lang.String path, java.lang.String owner) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
discoverOwnLocks
public void discoverOwnLocks() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionDiscover and refresh lock tokens.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
discoverOwnLocks
public void discoverOwnLocks(java.lang.String owner) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionDiscover and refresh lock tokens for a specific owner.- Parameters:
owner- the owner who's locks are to be discovered.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
discoverLock
protected WebdavState discoverLock(java.lang.String owner, java.lang.String path, WebdavState state)
Discover the given owner and locktoken and set the locktoken- Parameters:
owner- the activelock ownerpath- the server relative path of the resource to requeststate- the state to save the locktoken- Returns:
- state probably having lock information renewly
-
updateMethod
public boolean updateMethod(java.lang.String target) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionUpdate 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
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
updateMethod
public boolean updateMethod(java.lang.String path, java.lang.String target) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionUpdate the specified resource to the specified target- Parameters:
path- the server relative path of the resource to updatetarget- path of the target to update from (history resource)- Returns:
- true if the method has succeeded
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
versionControlMethod
public boolean versionControlMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOException- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
versionControlMethod
public boolean versionControlMethod(java.lang.String path, java.lang.String target) throws org.apache.commons.httpclient.HttpException, java.io.IOException- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
mkWorkspaceMethod
public boolean mkWorkspaceMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the MKWORKSPACE method for this WebdavResource.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
mkWorkspaceMethod
public boolean mkWorkspaceMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
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.
-
compareTo
public int compareTo(java.lang.Object another)
Compare to the given another object.- Parameters:
another- the other WebdavResource object- Returns:
- the value 0 if another is equal.
-
equals
public boolean equals(java.lang.Object obj)
Test the object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the other object- Returns:
- true if it's equal.
-
toString
public java.lang.String toString()
Return the http URL string.- Overrides:
toStringin classjava.lang.Object- Returns:
- the http URL string.
-
checkinMethod
public boolean checkinMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the CHECKIN method for this WebdavResource.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
checkinMethod
public boolean checkinMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
checkoutMethod
public boolean checkoutMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the CHECKOUT method for this WebdavResource.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
checkoutMethod
public boolean checkoutMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
uncheckoutMethod
public boolean uncheckoutMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the CHECKOUT method for this WebdavResource.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
uncheckoutMethod
public boolean uncheckoutMethod(java.lang.String path) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
createWebdavResource
protected WebdavResource createWebdavResource(org.apache.commons.httpclient.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.
-
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.
-
aclReportMethod
public java.util.Enumeration aclReportMethod(java.lang.String path, java.util.Collection properties, int reportType) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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 requestproperties- The named properties.- Returns:
- an enumeration of
ResponseEntity - Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
bindMethod
public boolean bindMethod(java.lang.String newBinding) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setOverwrite(boolean)
-
bindMethod
public boolean bindMethod(java.lang.String existingBinding, java.lang.String newBinding) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the BIND method given the new path to bind to an existing path.- Parameters:
existingBinding- the existing binding as a server relative pathnewBinding- the new binding as a server relative path- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setOverwrite(boolean)
-
unbindMethod
public boolean unbindMethod() throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute the UNBIND method for this WebdavResource.- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
unbindMethod
public boolean unbindMethod(java.lang.String binding) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
rebindMethod
public boolean rebindMethod(java.lang.String newBinding) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setOverwrite(boolean)
-
rebindMethod
public boolean rebindMethod(java.lang.String existingBinding, java.lang.String newBinding) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionExecute 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 pathnewBinding- the new binding as a server relative path- Returns:
- true if the method is succeeded.
- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException- See Also:
setOverwrite(boolean)
-
subscribeMethod
public Subscription subscribeMethod(java.lang.String path, java.lang.String notificationType, java.lang.String callback, long notificationDelay, int depth, long lifetime) throws org.apache.commons.httpclient.HttpException, java.io.IOException
Subscribes for notifications for modifications of WebDAV resources.- Parameters:
path- URL path of the resource that is to be subscribednotificationType-callback- the URL to be registered for notification, may benullif no callback shall be registered.notificationDelay-depth- the depth of the subscription (for valid values seeDepthSupport)lifetime- duration of that subscription in seconds (Note: the server may change this and return an other one; seeSubscription.getLifetime().- Returns:
- a
Subscriptionornullif an error occurs - Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
subscribeMethod
public boolean subscribeMethod(java.lang.String path, int subscriptionId) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionRefreshes a subscription.- Returns:
trueon success.- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
subscribeMethod
public boolean subscribeMethod(Subscription subscription) throws org.apache.commons.httpclient.HttpException, java.io.IOException
Refreshes a subscription.- Parameters:
subscription- The subscription to be refreshed.- Returns:
trueon success- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
unsubscribeMethod
public boolean unsubscribeMethod(java.lang.String path, int subscriptionId) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionCancels a subscription.- Parameters:
path- URL path for that was subscribed- Returns:
trueon success- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
unsubscribeMethod
public boolean unsubscribeMethod(Subscription subscription) throws org.apache.commons.httpclient.HttpException, java.io.IOException
Cancels a subscription.- Parameters:
subscription-- Returns:
trueon success- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
pollMethod
public boolean pollMethod(java.lang.String contentLocation, int subscriptionId) throws org.apache.commons.httpclient.HttpException, java.io.IOExceptionAsks the server whether events for a given subscription are fired.- Parameters:
contentLocation- URL path returned by the SUBSCRIBE methods Content-Location headersubscriptionId- id of the subscription- Returns:
trueif an event was fired- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
pollMethod
public boolean pollMethod(Subscription subscription) throws org.apache.commons.httpclient.HttpException, java.io.IOException
Asks the server whether events for a given subscription are fired.- Parameters:
subscription- the subscription to ask for- Returns:
trueif an event was fired- Throws:
org.apache.commons.httpclient.HttpExceptionjava.io.IOException
-
-