|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object be.re.webdav.Client
public class Client
A client API for accessing a WebDAV server.
Nested Class Summary | |
---|---|
static class |
Client.ACE
Represents one Access Control Entry in an Access Control List. |
static interface |
Client.AuditTrail
An interface to handle a stream of audit trail events. |
static class |
Client.Event
Represents one event line in an audit trail. |
static class |
Client.Lock
Represents a lock. |
static class |
Client.Options
Contains the result of an options request. |
static class |
Client.Response
Contains the response of a WebDAV operation. |
Constructor Summary | |
---|---|
Client()
Calls the full constructor with all parameters set to null . |
|
Client(String username,
Object context)
This is the constructor for local WebDAV-calls from Pincette modules. |
|
Client(String username,
String password)
Calls the full constructor with the other parameters set to null . |
|
Client(String username,
String password,
String onBehalfOf)
Calls the full constructor with the other parameters set to null . |
|
Client(String username,
String password,
String onBehalfOf,
Locale locale,
String userAgent)
|
Method Summary | |
---|---|
void |
acl(URL url,
Client.ACE[] aces)
Sets the Access Control List for the resource. |
void |
addLabel(URL url,
String label)
Adds a label to the resource. |
Client.Response |
addLabel(URL url,
String label,
String selectionLabel,
String depth)
Adds a label to the resource. |
Client.Response |
addLabel(URL url,
String label,
String selectionLabel,
String depth,
String lockToken)
Adds a label to the resource. |
void |
audit(URL url,
String path,
String[] operations,
String username,
long before,
long after,
String additionalInfo,
Client.AuditTrail handler)
Returns the audit trail for a given resource. |
void |
bind(URL url,
URL newBinding,
boolean overwrite)
Creates an additional binding to an existing resource. |
void |
bind(URL url,
URL newBinding,
boolean overwrite,
String lockToken)
Creates an additional binding to an existing resource. |
String |
checkin(URL url)
Checks in a resource. |
String |
checkin(URL url,
boolean keepCheckedOut,
boolean forkOK)
Checks in a resource. |
String |
checkin(URL url,
boolean keepCheckedOut,
boolean forkOK,
String lockToken)
Checks in a resource. |
void |
checkout(URL url)
Checks out a resource. |
void |
checkout(URL url,
URL activity,
boolean forkOK)
Checks out a resource. |
void |
checkout(URL url,
URL activity,
boolean forkOK,
String lockToken)
Checks out a resource. |
void |
collapse(URL url,
boolean noVersionControl,
String depth)
|
Client.Response |
copy(URL from,
URL to,
String label,
boolean overwrite,
String depth)
Copies the resource denoted by from to the resource denoted
by to . |
void |
delete(URL url)
Deletes a resource. |
void |
delete(URL url,
String lockToken)
Deletes a resource. |
Client.Response |
get(URL url)
Returns a resource. |
Client.Response |
get(URL url,
String[] preferredMimeTypes,
String[] preferredLanguages,
String label)
Returns a resource. |
Client.Response |
get(URL url,
String[] preferredMimeTypes,
String[] preferredLanguages,
String label,
long modifiedSince)
Returns a resource. |
Client.Response |
get(URL url,
String[] preferredMimeTypes,
String[] preferredLanguages,
String label,
URL compareWith)
Returns a resource. |
Client.ACE[] |
getAcl(URL url)
Returns the Access Control List of a resource. |
URL[] |
getActivityCollections(URL url)
Returns the resource collections in the repository denoted by url that contain activities. |
Locale |
getLocale()
Returns the default locale that will be assigned to the Accept-Language header if it is not yet present. |
Client.Lock[] |
getLocks(URL url)
Returns all the locks of a resource. |
String[] |
getLockTokens(URL url)
Returns all the lock tokens of a resource. |
URL[] |
getMetaCollections(URL url)
Returns the resource collections in the repository denoted by url that contain functional meta collections. |
String |
getOnBehalfOf()
Returns the default value for the X-be.re.On-Behalf-Of header. |
String |
getPassword()
Return the default password for basic HTTP authentication. |
URL[] |
getPrincipalCollections(URL url)
Returns the resource collections in the repository denoted by url that contain principals. |
String |
getSimpleLiveProperty(URL url,
ExpandedName property)
Returns the value of a live property as a string if it has either one empty element as a value, in which case the local name of the element is the value, or only PCDATA, otherwise null is
returned. |
String |
getSimpleLiveProperty(URL url,
String property)
Returns the value of a live property in the DAV: namespace
as a string if it has one empty element as a value, in which case the local
name of the element is the value, or only PCDATA,
otherwise null is returned. |
ExpandedName[] |
getSupportedLiveProperties(URL url)
Returns all the live properties supported by the resource. |
String |
getUserAgent()
Returns the default value for the User-Agent header. |
String |
getUsername()
Returns the default username for basic HTTP authentication. |
URL[] |
getVersionHistoryCollections(URL url)
Returns the resource collections in the repository denoted by url that contain version histories. |
URL[] |
getViewCollections(URL url)
Returns the resource collections in the repository denoted by url that contain views. |
Headers |
head(URL url)
Returns the headers of a resource. |
void |
index(URL url,
String depth,
boolean withPreview)
This is an administration method that reindexes a WebDAV-collection in Pincette. |
String |
lock(URL url,
long timeoutSeconds)
Locks a resource. |
String |
lock(URL url,
long timeoutSeconds,
String lockToken)
Locks a resource. |
Client.Response |
merge(URL url,
URL[] sources,
String label,
boolean autoMerge,
boolean checkOut,
URL checkOutActivity,
boolean forkOK)
Merges a number of resources into another one. |
void |
mkactivity(URL url)
Creates an activity. |
void |
mkcol(URL url)
Creates a resource collection. |
void |
mkview(URL url)
Creates a view. |
void |
move(URL from,
URL to,
boolean overwrite)
Moves one resource to another. |
void |
move(URL from,
URL to,
boolean overwrite,
String lockToken)
Moves one resource to another. |
Client.Response |
operation(String method,
URL url,
Headers headersIn,
InputStream body)
The low-level method that communicates with the server. |
Client.Options |
options(URL url,
boolean activityCollections,
boolean metaCollections,
boolean versionHistoryCollections,
boolean viewCollections)
Returns the options for a resource. |
Client.Response |
propfindAll(URL url,
String depth)
Returns all the properties of a resource. |
ExpandedName[] |
propfindNames(URL url)
Returns all the property names of a resource. |
Client.Response |
propfindNames(URL url,
String depth)
Returns all the property names of a resource. |
Client.Response |
propfindSpecific(URL url,
ExpandedName[] properties,
String depth)
Returns the requested properties of a resource. |
Client.Response |
proppatch(URL url,
Document document)
Changes properties of the resource. |
Client.Response |
proppatch(URL url,
Document document,
String lockToken)
Changes properties of the resource. |
Client.Response |
proppatch(URL url,
InputStream in)
Changes properties of the resource. |
Client.Response |
proppatch(URL url,
InputStream in,
String lockToken)
Changes properties of the resource. |
Client.Response |
put(URL url,
InputStream in,
String mimeType,
String language)
Creates or updates a resource. |
Client.Response |
put(URL url,
InputStream in,
String mimeType,
String language,
String lockToken)
Creates or updates a resource. |
void |
rebind(URL url,
URL newBinding,
boolean overwrite)
Replaces a binding to an existing resource. |
void |
rebind(URL url,
URL newBinding,
boolean overwrite,
String lockToken)
Replaces a binding to an existing resource. |
void |
removeLabel(URL url,
String label)
Removes a label from the resource. |
Client.Response |
removeLabel(URL url,
String label,
String selectionLabel,
String depth)
Removes a label from the resource. |
Client.Response |
removeLabel(URL url,
String label,
String selectionLabel,
String depth,
String lockToken)
Removes a label from the resource. |
Client.Response |
report(URL url,
Document document,
String label,
String depth)
This is a variant of the other report method. |
Client.Response |
report(URL url,
InputStream in,
String label,
String depth)
With this method more complex information can be retrieved about a resource. |
void |
setLabel(URL url,
String label)
Sets a label on the resource. |
Client.Response |
setLabel(URL url,
String label,
String selectionLabel,
String depth)
Sets a label on the resource. |
Client.Response |
setLabel(URL url,
String label,
String selectionLabel,
String depth,
String lockToken)
Sets a label on the resource. |
void |
setLocale(Locale value)
Sets the default locale that will be assigned to the Accept-Language header if it is not yet present. |
void |
setOnBehalfOf(String value)
Sets the X-be.re.On-Behalf-Of header. |
void |
setPassword(String value)
Sets the default password for basic HTTP authentication. |
void |
setSimpleLiveProperty(URL url,
ExpandedName property,
String value)
Sets the value of a simple live property. |
void |
setSimpleLiveProperty(URL url,
ExpandedName property,
String value,
String lockToken)
Sets the value of a simple live property. |
void |
setSimpleLiveProperty(URL url,
String property,
String value)
Sets the value of a simple live property. |
void |
setSimpleLiveProperty(URL url,
String property,
String value,
String lockToken)
Sets the value of a simple live property. |
void |
setUserAgent(String userAgent)
Sets the default value for the User-Agent header. |
void |
setUsername(String value)
Sets the default username for basic HTTP authentication. |
void |
unbind(URL url)
Removes a binding to a resource. |
void |
unbind(URL url,
String lockToken)
Removes a binding to a resource. |
void |
uncheckout(URL url)
Reverts the check-out of a resource. |
void |
uncheckout(URL url,
String lockToken)
Reverts the check-out of a resource. |
void |
unlock(URL url,
String lockToken)
Unlocks a resource. |
void |
versionControl(URL url)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Client()
null
.
public Client(String username, String password)
null
.
public Client(String username, String password, String onBehalfOf)
null
.
public Client(String username, String password, String onBehalfOf, Locale locale, String userAgent)
username
- if set it will be used for basic HTTP authentication.password
- if set it will be used for basic HTTP authentication.onBehalfOf
- if set it will be used as the value for the
X-be.re.On-Behalf-Of
header. This feature is specific for
Pincette, where the systemuser honours the header to perform an operation on behalf of another user. This makes it possible to use Pincette as a resource in an application, in the same way database systems can be used for example.
locale
- the default locale that will be assigned to the
Accept-Language
header if it is not yet present.userAgent
- if set it will override the User-Agent
header.public Client(String username, Object context)
username
- the user as who the call is performed.context
- the WebDAV-context.Method Detail |
---|
public void acl(URL url, Client.ACE[] aces) throws IOException, be.re.net.ProtocolException
url
- the resource.aces
- the Access Control Entries.
IOException
be.re.net.ProtocolException
public void addLabel(URL url, String label) throws IOException, be.re.net.ProtocolException
url
- the resource.label
- the label that is to be added.
IOException
be.re.net.ProtocolException
public Client.Response addLabel(URL url, String label, String selectionLabel, String depth) throws IOException, be.re.net.ProtocolException
url
- the resource.label
- the label that is to be added.selectionLabel
- an optional label that overrides the default
version selection. The version carrying selectionLabel
will
be the subject of the operation.depth
- the scope of application of the label. It can have the
following values:
be.re.webdav.Util.reportMultistatus()
if the status code is
207. Otherwise the status code 200 indicates success.
IOException
be.re.net.ProtocolException
Util.reportMultistatus(Client.Response, Util.ReportMultistatus)
public Client.Response addLabel(URL url, String label, String selectionLabel, String depth, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource.label
- the label that is to be added.selectionLabel
- an optional label that overrides the default
version selection. The version carrying selectionLabel
will
be the subject of the operation.depth
- the scope of application of the label. It can have the
following values:
lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
be.re.webdav.Util.reportMultistatus()
if the status code is
207. Otherwise the status code 200 indicates success.
IOException
be.re.net.ProtocolException
Util.reportMultistatus(Client.Response, Util.ReportMultistatus)
public void audit(URL url, String path, String[] operations, String username, long before, long after, String additionalInfo, Client.AuditTrail handler) throws IOException, be.re.net.ProtocolException
url
- the repository URL.path
- the absolute path of a resource within the repository. The
wildcard *
is allowed. It may be null
.operations
- limits the audit trail to events with the given
operations. Operations are defined in Constants.EVENT_*
. It
may be null
.username
- limits the audit trail to events involving the given user.
It may be null
.before
- limits the audit trail to events before the given timestamp
in milliseconds since 1 January 1970 UTC. It may be -1.after
- limits the audit trail to events after the given timestamp
in milliseconds since 1 January 1970 UTC. It may be -1.additionalInfo
- limits the audit trail to events having the given
additional information. The wildcard *
is allowed. It may be
null
.handler
- an interface to which the events are passed one by one.
IOException
be.re.net.ProtocolException
Constants
public void bind(URL url, URL newBinding, boolean overwrite) throws IOException, be.re.net.ProtocolException
url
- the existing resourcenewBinding
- the new URL for the resource.overwrite
- if set to true
and there already is a
resource denoted by newBinding
, then overwrite it.
IOException
be.re.net.ProtocolException
public void bind(URL url, URL newBinding, boolean overwrite, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the existing resourcenewBinding
- the new URL for the resource.overwrite
- if set to true
and there already is a
resource denoted by newBinding
, then overwrite it.lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
IOException
be.re.net.ProtocolException
public String checkin(URL url) throws IOException, be.re.net.ProtocolException
keepCheckedOut
and
forkOK
are set to false
and
lockToken
is set to null
.
url
- the resource.
IOException
be.re.net.ProtocolException
public String checkin(URL url, boolean keepCheckedOut, boolean forkOK) throws IOException, be.re.net.ProtocolException
url
- the resource.keepCheckedOut
- will automatically check out the resource after the
check-in.forkOK
- when set to true
forking a line of descent is
allowed.
IOException
be.re.net.ProtocolException
public String checkin(URL url, boolean keepCheckedOut, boolean forkOK, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource.keepCheckedOut
- will automatically check out the resource after the
check-in.forkOK
- when set to true
forking a line of descent is
allowed.lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
IOException
be.re.net.ProtocolException
public void checkout(URL url) throws IOException, be.re.net.ProtocolException
activity
parameter is set to
null
, forkOK
to false
and
lockToken
to null
.
url
- the resource.
IOException
be.re.net.ProtocolException
public void checkout(URL url, URL activity, boolean forkOK) throws IOException, be.re.net.ProtocolException
url
- the resource.activity
- the activity in which the resource should be checked out.forkOK
- when set to true
forking a line of descent is
allowed.
IOException
be.re.net.ProtocolException
public void checkout(URL url, URL activity, boolean forkOK, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource.activity
- the activity in which the resource should be checked out.forkOK
- when set to true
forking a line of descent is
allowed.lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
IOException
be.re.net.ProtocolException
public void collapse(URL url, boolean noVersionControl, String depth) throws IOException, be.re.net.ProtocolException
IOException
be.re.net.ProtocolException
public Client.Response copy(URL from, URL to, String label, boolean overwrite, String depth) throws IOException, be.re.net.ProtocolException
from
to the resource denoted
by to
.
from
- the resource that is to be copied.to
- the resource that is to be copied to.label
- an optional label that overrides the default
version selection. The version carrying label
will
be the subject of the operation.overwrite
- if set the target will be overwritten if it already
exists.depth
- the scope of the copy operation. It can have the
following values:
be.re.webdav.Util.reportMultistatus()
if the status code is
207. Otherwise the status codes 201 and 204 indicate success. See section
9.8.5 of RFC 4918 for
the complete specification of the status codes.
IOException
be.re.net.ProtocolException
Util.reportMultistatus(Client.Response, Util.ReportMultistatus)
public void delete(URL url) throws IOException, be.re.net.ProtocolException
url
- the resource.
IOException
be.re.net.ProtocolException
public void delete(URL url, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource.lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
IOException
be.re.net.ProtocolException
public Client.Response get(URL url) throws IOException, be.re.net.ProtocolException
url
- the URL of the resource to get. It should be either a version
controlled resource or a version resource.
IOException
be.re.net.ProtocolException
public Client.Response get(URL url, String[] preferredMimeTypes, String[] preferredLanguages, String label) throws IOException, be.re.net.ProtocolException
url
- the URL of the resource to get. It should be either a version
controlled resource or a version resource.preferredMimeTypes
- the MIME types in which form the result is
desired, ordered from most to least preferred. It may be null
or empty.preferredLanguages
- the languages in which form the result is
desired, ordered from most to least preferred. It may be null
or empty.label
- an optional label that overrides the default
version selection. The version carrying label
will
be the subject of the operation.
IOException
be.re.net.ProtocolException
public Client.Response get(URL url, String[] preferredMimeTypes, String[] preferredLanguages, String label, URL compareWith) throws IOException, be.re.net.ProtocolException
url
- the URL of the resource to get. It should be either a version
controlled resource or a version resource.preferredMimeTypes
- the MIME types in which form the result is
desired, ordered from most to least preferred. It may be null
or empty.preferredLanguages
- the languages in which form the result is
desired, ordered from most to least preferred. It may be null
or empty.label
- an optional label that overrides the default
version selection. The version carrying label
will
be the subject of the operation.compareWith
- a version of the same version controlled resource. It
may be null
. This parameter is specific for Pincette.
IOException
be.re.net.ProtocolException
public Client.Response get(URL url, String[] preferredMimeTypes, String[] preferredLanguages, String label, long modifiedSince) throws IOException, be.re.net.ProtocolException
url
- the URL of the resource to get. It should be either a version
controlled resource or a version resource.preferredMimeTypes
- the MIME types in which form the result is
desired, ordered from most to least preferred. It may be null
or empty.preferredLanguages
- the languages in which form the result is
desired, ordered from most to least preferred. It may be null
or empty.label
- an optional label that overrides the default
version selection. The version carrying label
will
be the subject of the operation.modifiedSince
- the timestamp in milliseconds since 1 January 1970
UTC. It may be -1 if an unconditional GET is desired. Otherwise the
resource is only returned if it has changed since the given timestamp. If
it hasn't, the status code is set to 304.
IOException
be.re.net.ProtocolException
public Client.ACE[] getAcl(URL url) throws IOException, be.re.net.ProtocolException
IOException
be.re.net.ProtocolException
public URL[] getActivityCollections(URL url) throws IOException, be.re.net.ProtocolException
url
that contain activities.
IOException
be.re.net.ProtocolException
public Locale getLocale()
Accept-Language
header if it is not yet present.
public String[] getLockTokens(URL url) throws IOException, be.re.net.ProtocolException
IOException
be.re.net.ProtocolException
public Client.Lock[] getLocks(URL url) throws IOException, be.re.net.ProtocolException
IOException
be.re.net.ProtocolException
public URL[] getMetaCollections(URL url) throws IOException, be.re.net.ProtocolException
url
that contain functional meta collections. This method is
specific to Pincette.
IOException
be.re.net.ProtocolException
public String getOnBehalfOf()
X-be.re.On-Behalf-Of
header.
A system user can use this to perform requests on behalf of another user.
This way a WebDAV server can be used as a resource by another service, much
like a database system.
public String getPassword()
public URL[] getPrincipalCollections(URL url) throws IOException, be.re.net.ProtocolException
url
that contain principals.
IOException
be.re.net.ProtocolException
public String getSimpleLiveProperty(URL url, ExpandedName property) throws IOException, be.re.net.ProtocolException
null
is
returned.
IOException
be.re.net.ProtocolException
public String getSimpleLiveProperty(URL url, String property) throws IOException, be.re.net.ProtocolException
DAV:
namespace
as a string if it has one empty element as a value, in which case the local
name of the element is the value, or only PCDATA,
otherwise null
is returned.
IOException
be.re.net.ProtocolException
public ExpandedName[] getSupportedLiveProperties(URL url) throws IOException, be.re.net.ProtocolException
IOException
be.re.net.ProtocolException
public String getUserAgent()
User-Agent
header.
public String getUsername()
public URL[] getVersionHistoryCollections(URL url) throws IOException, be.re.net.ProtocolException
url
that contain version histories.
IOException
be.re.net.ProtocolException
public URL[] getViewCollections(URL url) throws IOException, be.re.net.ProtocolException
url
that contain views. This method is specific to Pincette.
IOException
be.re.net.ProtocolException
public Headers head(URL url) throws IOException, be.re.net.ProtocolException
IOException
be.re.net.ProtocolException
public void index(URL url, String depth, boolean withPreview) throws IOException, be.re.net.ProtocolException
url
- the collection.depth
- the WebDAV Depth
header.withPreview
- when set to true
the previews are also
re-extracted next to full-text indexing.
IOException
be.re.net.ProtocolException
public String lock(URL url, long timeoutSeconds) throws IOException, be.re.net.ProtocolException
url
- the resource to be locked.timeoutSeconds
- the time in seconds the lock should last. If the
lock hasn't been refreshed before this time has passed, it will be
automatically released. The value -1 indicates an infinite timeout. Note
that a server may impose restrictions of its own.
IOException
be.re.net.ProtocolException
public String lock(URL url, long timeoutSeconds, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource to be locked.timeoutSeconds
- the time in seconds the lock should last. If the
lock hasn't been refreshed before this time has passed, it will be
automatically released. The value -1 indicates an infinite timeout. Note
that a server may impose restrictions of its own.lockToken
- a lock token. It may be null
. If it isn't it
denotes the lock to refresh.
IOException
be.re.net.ProtocolException
public Client.Response merge(URL url, URL[] sources, String label, boolean autoMerge, boolean checkOut, URL checkOutActivity, boolean forkOK) throws IOException, be.re.net.ProtocolException
url
- the resource to merge into.sources
- the resources that are to be merged.label
- and optional label that overrides the default
version selection. For all the sources the version carrying
label
will be the subject of the operation. This parameter is
specific to Pincette.autoMerge
- allow the server to perform an automatic merge if it can.
Otherwise the merge is only registered and should be completed manually.checkOut
- allow the server to check out a resource if needed.checkOutActivity
- the activity in which the automatic check-out
should occur.forkOK
- when set to true
forking a line of descent is
allowed.
be.re.webdav.Util.reportMultistatus()
to process the
response, where the status code 200 indicates success.
IOException
be.re.net.ProtocolException
Util.reportMultistatus(Client.Response, Util.ReportMultistatus)
public void mkactivity(URL url) throws IOException, be.re.net.ProtocolException
IOException
be.re.net.ProtocolException
public void mkcol(URL url) throws IOException, be.re.net.ProtocolException
IOException
be.re.net.ProtocolException
public void mkview(URL url) throws IOException, be.re.net.ProtocolException
IOException
be.re.net.ProtocolException
public void move(URL from, URL to, boolean overwrite) throws IOException, be.re.net.ProtocolException
from
- the resource to be moved.to
- the new URL for the resource.overwrite
- if set to true
and there already is a
resource denoted by to
, then overwrite it.
IOException
be.re.net.ProtocolException
public void move(URL from, URL to, boolean overwrite, String lockToken) throws IOException, be.re.net.ProtocolException
from
- the resource to be moved.to
- the new URL for the resource.overwrite
- if set to true
and there already is a
resource denoted by to
, then overwrite it.lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
IOException
be.re.net.ProtocolException
public Client.Response operation(String method, URL url, Headers headersIn, InputStream body) throws IOException, be.re.net.ProtocolException
method
- the method.url
- the URL of the resource.headersIn
- the header that will be set on the request.body
- the request body.
IOException
be.re.net.ProtocolException
public Client.Options options(URL url, boolean activityCollections, boolean metaCollections, boolean versionHistoryCollections, boolean viewCollections) throws IOException, be.re.net.ProtocolException
url
- the resource.activityCollections
- if set to true
the collections
that contain activities will be requested.metaCollections
- if set to true
the collections
that contain functional meta collections will be requested. This is
specific to Pincette.versionHistoryCollections
- if set to true
the
collections that contain version histories will be requested.viewCollections
- if set to true
the collections
that contain views will be requested. This is specific to Pincette.
IOException
be.re.net.ProtocolException
public Client.Response propfindAll(URL url, String depth) throws IOException, be.re.net.ProtocolException
url
- the resource.depth
- the scope of the operation. It can have the
following values:
IOException
be.re.net.ProtocolException
public Client.Response propfindNames(URL url, String depth) throws IOException, be.re.net.ProtocolException
url
- the resource.depth
- the scope of the operation. It can have the
following values:
IOException
be.re.net.ProtocolException
public ExpandedName[] propfindNames(URL url) throws IOException, be.re.net.ProtocolException
IOException
be.re.net.ProtocolException
public Client.Response propfindSpecific(URL url, ExpandedName[] properties, String depth) throws IOException, be.re.net.ProtocolException
url
- the resource.properties
- the requested properties.depth
- the scope of the operation. It can have the
following values:
IOException
be.re.net.ProtocolException
public Client.Response proppatch(URL url, InputStream in) throws IOException, be.re.net.ProtocolException
url
- the resource.in
- the request body. It is specified in section 9.2 of RFC 4918.
be.re.webdav.Util.reportMultistatus()
to process the
response. See section 9.2.1 of
RFC 4918 for the
specification of the status codes.
IOException
be.re.net.ProtocolException
Util.reportMultistatus(Client.Response, Util.ReportMultistatus)
public Client.Response proppatch(URL url, InputStream in, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource.in
- the request body. It is specified in section 9.2 of RFC 4918.lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
be.re.webdav.Util.reportMultistatus()
to process the
response. See section 9.2.1 of
RFC 4918 for the
specification of the status codes.
IOException
be.re.net.ProtocolException
Util.reportMultistatus(Client.Response, Util.ReportMultistatus)
public Client.Response proppatch(URL url, Document document) throws IOException, be.re.net.ProtocolException
url
- the resource.document
- the request body. It is specified in section 9.2 of RFC 4918.
be.re.webdav.Util.reportMultistatus()
to process the
response. See section 9.2.1 of
RFC 4918 for the
specification of the status codes.
IOException
be.re.net.ProtocolException
Util.reportMultistatus(Client.Response, Util.ReportMultistatus)
public Client.Response proppatch(URL url, Document document, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource.document
- the request body.lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
be.re.webdav.Util.reportMultistatus()
to process the
response. See section 9.2.1 of
RFC 4918 for the
specification of the status codes.
IOException
be.re.net.ProtocolException
Util.reportMultistatus(Client.Response, Util.ReportMultistatus)
public Client.Response put(URL url, InputStream in, String mimeType, String language) throws IOException, be.re.net.ProtocolException
url
- the resource that will be updated. If it doesn't exist it will
be created.in
- the request body. If it is null
an empty request
body will be sent.mimeType
- the MIME type of the request body. If it is
null
the MIME type application/octet-stream
is
used.language
- the natural language of the request body. It may be
null
.
IOException
be.re.net.ProtocolException
public Client.Response put(URL url, InputStream in, String mimeType, String language, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource that will be updated. If it doesn't exist it will
be created.in
- the request body. If it is null
an empty request
body will be sent.mimeType
- the MIME type of the request body. If it is
null
the MIME type application/octet-stream
is
used.language
- the natural language of the request body. It may be
null
.lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
IOException
be.re.net.ProtocolException
public void rebind(URL url, URL newBinding, boolean overwrite) throws IOException, be.re.net.ProtocolException
url
- the existing resourcenewBinding
- the new URL for the resource.overwrite
- if set to true
and there already is a
resource denoted by newBinding
, then overwrite it.
IOException
be.re.net.ProtocolException
public void rebind(URL url, URL newBinding, boolean overwrite, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the existing resourcenewBinding
- the new URL for the resource.overwrite
- if set to true
and there already is a
resource denoted by newBinding
, then overwrite it.lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
IOException
be.re.net.ProtocolException
public void removeLabel(URL url, String label) throws IOException, be.re.net.ProtocolException
url
- the resourcelabel
- the label that is to be removed.
IOException
be.re.net.ProtocolException
public Client.Response removeLabel(URL url, String label, String selectionLabel, String depth) throws IOException, be.re.net.ProtocolException
url
- the resource.label
- the label that is to be removed.selectionLabel
- an optional label that overrides the default
version selection. The version carrying selectionLabel
will
be the subject of the operation.depth
- the scope of application of the label. It can have the
following values:
be.re.webdav.Util.reportMultistatus()
if the status code is
207. Otherwise the status code 200 indicates success.
IOException
be.re.net.ProtocolException
Util.reportMultistatus(Client.Response, Util.ReportMultistatus)
public Client.Response removeLabel(URL url, String label, String selectionLabel, String depth, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource.label
- the label that is to be removed.selectionLabel
- an optional label that overrides the default
version selection. The version carrying selectionLabel
will
be the subject of the operation.depth
- the scope of application of the label. It can have the
following values:
lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
be.re.webdav.Util.reportMultistatus()
if the status code is
207. Otherwise the status code 200 indicates success.
IOException
be.re.net.ProtocolException
Util.reportMultistatus(Client.Response, Util.ReportMultistatus)
public Client.Response report(URL url, InputStream in, String label, String depth) throws IOException, be.re.net.ProtocolException
With this method more complex information can be retrieved about a resource. The following WebDAV reports exist:
The reports that are supported by a resource can be discovered through
the supported-report-set
property.
Pincette has the extension report simple-search
in the
namespace urn:be-re:dav
. This is a report for general purpose
queries. It returns the list of resources that matches the query,
accompanied by properties if requested. The syntax is as follows:
<!ELEMENT simple-search ((and|or|not|expr|(field,op,value)),(prop)?)> <!ELEMENT prop ANY> <!ELEMENT and (expr)+> <!ELEMENT or (expr)+> <!ELEMENT expr (and|or|not|expr|(field,op,value))> <!ELEMENT not (and|or|not|expr|(field,op,value))> <!ELEMENT field (#PCDATA)> <!ELEMENT op (#PCDATA)> <!ELEMENT value (#PCDATA)>
The prop
element should contain empty property name
elements. The following table lists the supported fields, their operators
and possible values:
Field | Operators | Values |
---|---|---|
activity-set | contains | activity URL |
auto-merged | = | true or false |
contains | = | Lucene text query |
displayname | =, != | string (wildcard "*") |
checked-out | = | true or false |
creation-date | =, !=, <, >, <=, >= | ISO 8601 timestamp |
creator-displayname | =, != | string (wildcard "*") |
getcontentlanguage | =, != | string (wildcard "*") |
getcontentlength | =, !=, <, >, <=, >= | natural number |
getcontenttype | =, != | string (wildcard "*") |
getlastmodified | =, !=, <, >, <=, >= | ISO 8601 timestamp |
label-name-set | contains | string |
not-label | = | string |
merge-incomplete | = | true or false |
meta.<property name> | =, != | string (wildcard "*") |
owner | =, != | string (wildcard "*") |
url
- the resource for which the report is requested.in
- the request document.label
- an optional label that overrides the default
version selection. The version carrying label
will
be the subject of the operation. This parameter is specific to Pincette.depth
- the scope of the report. It can have the following values:
IOException
be.re.net.ProtocolException
public Client.Response report(URL url, Document document, String label, String depth) throws IOException, be.re.net.ProtocolException
report
method.
IOException
be.re.net.ProtocolException
public void setLabel(URL url, String label) throws IOException, be.re.net.ProtocolException
url
- the resource.label
- the label that is to be set.
IOException
be.re.net.ProtocolException
public Client.Response setLabel(URL url, String label, String selectionLabel, String depth) throws IOException, be.re.net.ProtocolException
url
- the resource.label
- the label that is to be set.selectionLabel
- an optional label that overrides the default
version selection. The version carrying selectionLabel
will
be the subject of the operation.depth
- the scope of application of the label. It can have the
following values:
be.re.webdav.Util.reportMultistatus()
if the status code is
207. Otherwise the status code 200 indicates success.
IOException
be.re.net.ProtocolException
Util.reportMultistatus(Client.Response, Util.ReportMultistatus)
public Client.Response setLabel(URL url, String label, String selectionLabel, String depth, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource.label
- the label that is to be set.selectionLabel
- an optional label that overrides the default
version selection. The version carrying selectionLabel
will
be the subject of the operation.depth
- the scope of application of the label. It can have the
following values:
lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
be.re.webdav.Util.reportMultistatus()
if the status code is
207. Otherwise the status code 200 indicates success.
IOException
be.re.net.ProtocolException
Util.reportMultistatus(Client.Response, Util.ReportMultistatus)
public void setLocale(Locale value)
Accept-Language
header if it is not yet present. It may be
null
.
public void setOnBehalfOf(String value)
X-be.re.On-Behalf-Of
header. A system user can use
this to perform requests on behalf of another user. This way a WebDAV
server can be used as a resource by another service, much like a database
system. It may be null
.
public void setPassword(String value)
null
.
public void setSimpleLiveProperty(URL url, ExpandedName property, String value) throws IOException, be.re.net.ProtocolException
url
- the resource that will be updated.property
- the name of the simple property.value
- the value.
IOException
be.re.net.ProtocolException
getSimpleLiveProperty(URL, ExpandedName)
public void setSimpleLiveProperty(URL url, ExpandedName property, String value, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource that will be updated.property
- the name of the simple property.value
- the value.lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
IOException
be.re.net.ProtocolException
getSimpleLiveProperty(URL, ExpandedName)
public void setSimpleLiveProperty(URL url, String property, String value) throws IOException, be.re.net.ProtocolException
url
- the resource that will be updated.property
- the local name of the simple property. The property is
assumed to be in the DAV:
namespace.value
- the value.
IOException
be.re.net.ProtocolException
getSimpleLiveProperty(URL, ExpandedName)
public void setSimpleLiveProperty(URL url, String property, String value, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource that will be updated.property
- the local name of the simple property. The property is
assumed to be in the DAV:
namespace.value
- the value.lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
IOException
be.re.net.ProtocolException
getSimpleLiveProperty(URL, ExpandedName)
public void setUserAgent(String userAgent)
User-Agent
header. It may be
null
.
public void setUsername(String value)
null
.
public void unbind(URL url) throws IOException, be.re.net.ProtocolException
url
- the resource.
IOException
be.re.net.ProtocolException
public void unbind(URL url, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource.lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
IOException
be.re.net.ProtocolException
public void uncheckout(URL url) throws IOException, be.re.net.ProtocolException
IOException
be.re.net.ProtocolException
public void uncheckout(URL url, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource.lockToken
- a lock token. It may be null
. If the
resource is locked, the lock token should correspond to the lock.
IOException
be.re.net.ProtocolException
public void unlock(URL url, String lockToken) throws IOException, be.re.net.ProtocolException
url
- the resource.lockToken
- a lock token. It must not be null
.
IOException
be.re.net.ProtocolException
public void versionControl(URL url) throws IOException, be.re.net.ProtocolException
IOException
be.re.net.ProtocolException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |