|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
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 ... |
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.
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,
MultiStatus multiStatus = method.getResponseBodyAsMultiStatus();
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |