Package org.apache.jackrabbit.webdav.client.methods

This package contains classes and utilities used to build a WebDAV client implementation.

See:
          Description

Interface Summary
DavMethod DavMethod...
 

Class Summary
AclMethod AclMethod...
BaselineControlMethod BaselineControlMethod...
BindMethod BindMethod creates a new binding to a resource.
CheckinMethod CheckinMethod...
CheckoutMethod CheckoutMethod...
CopyMethod CopyMethod...
DavMethodBase DavMethodBase...
DeleteMethod DeleteMethod...
LabelMethod LabelMethod...
LockMethod LockMethod...
MergeMethod MergeMethod...
MkActivityMethod MkActivityMethod...
MkColMethod MkColMethod...
MkWorkspaceMethod MkWorkspaceMethod...
MoveMethod MoveMethod...
OptionsMethod OptionsMethod...
OrderPatchMethod OrderPatchMethod...
PollMethod PollMethod imple
PropFindMethod PropFindMethod, as specified in RFC 4918, Section 9.1 Supported types: DavConstants.PROPFIND_ALL_PROP: all custom properties, plus the live properties defined in RFC2518/RFC4918 DavConstants.PROPFIND_ALL_PROP_INCLUDE: same as DavConstants.PROPFIND_ALL_PROP plus the properties specified in propNameSet DavConstants.PROPFIND_BY_PROPERTY: just the properties specified in propNameSet DavConstants.PROPFIND_PROPERTY_NAMES: just the property names Note: only WebDAV level 3 servers support DavConstants.PROPFIND_ALL_PROP_INCLUDE, older servers will ignore the extension and act as if DavConstants.PROPFIND_ALL_PROP was used.
PropPatchMethod PropPatchMethod...
PutMethod PutMethod...
RebindMethod RebindMethod replaces a binding to a resource (atomic version of move).
ReportMethod ReportMethod...
SearchMethod SearchMethod...
SubscribeMethod SubscribeMethod...
UnbindMethod UnbindMethod removes a binding to a resource (semantically equivalent to delete).
UncheckoutMethod UncheckoutMethod...
UnLockMethod UnLockMethod...
UnSubscribeMethod UnSubscribeMethod...
UpdateMethod UpdateMethod...
VersionControlMethod VersionControlMethod...
XmlRequestEntity XmlRequestEntity...
 

Package org.apache.jackrabbit.webdav.client.methods Description

This package contains classes and utilities used to build a WebDAV client implementation.
Currently it consists of DAV-specific extensions to the Jakarta Commons HttpClient, namely a set of methods.

How to use Jakarta Commons HttpClient

Please refer to the tutorial present with Jakarta Commons HttpClient for detailed instructions.

Simple Example

The following simple example illustrates the additional functionality exposed by the DavMethod which serves as basic interface for all WebDAV specific extensions:

First you need to create the HostConfiguration which at least must define the uri pointing to your WebDAV enabled server
    String uri = "http://your-webdav-server";
    HostConfiguration hostConfig = new HostConfiguration();
    hostConfig.setHost(uri);
Define a HttpConnectionManager, which also is responsible for eventual multithreading support:
    HttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
    HttpConnectionManagerParams params = new HttpConnectionManagerParams();
    int maxHostConnections = 20;
    params.setMaxConnectionsPerHost(hostConfig, maxHostConnections);
    connectionManager.setParams(params);
Create the HttpClient object and eventually pass the Credentials:
    HttpClient client = new HttpClient(connectionManager);
    client.setHostConfiguration(hostConfig);
    Credentials creds = new UsernamePasswordCredentials("userId", "pw");
    client.getState().setCredentials(AuthScope.ANY, creds);
In order to execute a WebDAV request, choose the appropriate DavMethod. For example, a PROPFIND request could look as follows:
    String propfindUri = "http://your-webdav-server/anyresource";
    DavMethod method = new PropFindMethod(propfindUri, DavConstants.PROPFIND_ALL_PROP, DavConstants.DEPTH_1);
    client.executeMethod(method);
The DavMethod interface defines two methods that allows you to determine if the request was successfully executed without need to evaluate the status line and knowing about the required status codes:
    method.checkSuccess();
In case of success you can retrieve the response body in an appropriate formate and process it according to you needs,
For a PROPFIND request use e.g. DavMethod.getResponseBodyAsMultiStatus():
    MultiStatus multiStatus = method.getResponseBodyAsMultiStatus();



Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.