| java.lang.Object com.ibm.webdav.Resource
All known Subclasses: com.ibm.webdav.Activity, com.ibm.webdav.VersionedResource, com.ibm.webdav.Collection,
Resource | public class Resource implements Serializable(Code) | | A Resource implements a client proxy of the Resource interface locally where
possible, and by delegating the methods that must be implemented by the server
to another proxy stub as specified by the protocol given
in the resource URL. This allows WebDAV client applications to communicate
with a server through multiple RPC protocols, including no protocol at all for
local access.
See Also: com.ibm.webdav.CollectionP See Also: com.ibm.webdav.Precondition.addStateTokenCondition author: Jim Amsden <jamsden@us.ibm.com> |
Constructor Summary | |
public | Resource() The default constructor. | public | Resource(Resource resource) A copy constructor. | public | Resource(String url) Construct a Resource with the given URL. | public | Resource(String url, TargetSelector targetSelector) Construct a Resource with the given URL. | public | Resource(String protocol, String host, int port, String file) Create a Resource from the given URL components.
Parameters: protocol - the protocol to use, http:, rmi:, or iiop: Parameters: host - the name or IP addres of the server host. | public | Resource(String protocol, String host, String file) Create a Resource from the given URL components. | public | Resource(URL url) Construct a Resource with the given URL. | public | Resource(URL url, TargetSelector targetSelector) Construct a Resource with the given URL. | public | Resource(URL context, String spec) Construct a Resource with the given URL specification in the given context. |
Method Summary | |
public void | addLabel(String label) Add a label to this revision of a versioned resource. | public MultiStatus | addProperties(PropertyName[] names, Element[] values) Add properties to a resource. | public void | addProperty(PropertyName name, Element value) | public void | cancelCheckOut() Cancel the checkout of this working resource, delete the
working resource, and remove any predecessor/successor
relationships created by checkout or merge. | public TargetSelector | checkOut() Check out a resource in order to create a new working resource.
A resource is checked out in the context of the workspace, and
can only be checked out once in a given activity. | public TargetSelector | checkOut(Workspace workspace) Check out a resource in order to create a new working resource.
A resource is checked out in the context of the workspace, and
can only be checked out once in a given activity. | public void | checkPoint(boolean makeCurrentTarget, boolean overwrite) Create a new revision of this resource, but keep it checked
out. | public void | checkin() Checkin a resource creating a new immutable revision and
releasing the revision so other user agents may subsequently
check it out. | public void | checkin(Activity activity, boolean makeCurrentTarget, boolean overwrite) Checkin a resource releasing it so other user agents may check
it out. | public void | checkin(boolean makeCurrentTarget, boolean overwrite) Checkin a resource releasing it so other user agents may check
it out. | public void | closeContentsOutputStream() This method must be called after the client has completed writing to the contents
output stream that was obtained from getContentsOutputStream() . | public void | closeContentsOutputStream(String sContentType) | public MultiStatus | copy(String destinationURL) Copy this resource to the destination URL. | public MultiStatus | copy(String destinationURL, boolean overwrite, Vector propertiesToCopy) Copy this resource to the destination URL.
Partial results are possible, check the returned status for details.
Parameters: destinationURL - the destination Parameters: overwrite - true implies overrite the destination if it exists Parameters: propertiesToCopy - a collection of properties that must be copied orthe method will fail. | public MultiStatus | delete() Delete this resouce from the server. | public Document | differencesWith(Resource resource) Return an XML document describing the differences between two
revisions, both contents and properties. | public boolean | equals(Resource resource) Two Resources are equal if they have the same URL. | public boolean | exists() See if the contents of this resource exists. | public void | flushCaches() Flush any caches so that subsequent methods obtain fresh data from the server. | public ActiveLock | getActiveLockFor(String principal) Get the active lock on this resource owned by the given principal if any.
NOTE: this method cannot be reliably implemented based on version 10 of
the WebDAV spec as an activelock element in a lockdiscovery does not contain
the authorization credentials of the owner of the lock. | public Activity | getActivity() Get the activity this revision was created in. | public byte[] | getContents() Get the contents of this resource. | public InputStream | getContentsInputStream() Get an InputStream for accessing the contents of this resource. | public OutputStream | getContentsOutputStream() Get an OutputStream for setting the contents of this resource. | public ResourceContext | getContext() | public Enumeration | getLabels() Return all the labels on this revision, not including its revision id. | public Vector | getLocks() Get the locks that exist on this resource. | public Enumeration | getMergeCandidates() Return a list of activities on different lines of descent
for this revision that are candidates for merging. | public Enumeration | getMergePredecessors() Get the predecessors of this revision that were established
by merging changes from another activity. | public void | getMetaInformation() This method can be used for obtaining meta-information about this resource without
actually reading the resource contents. | public Enumeration | getMutableProperties() A resource may have a number of mutable properties. | public Element | getOptions() Get the options for this resource. | public Collection | getParentCollection() Get the collection containing this resource. | public Resource | getPredecessor() Get the predecessor of this revision. | public MultiStatus | getProperties() Get all the properties of this resource.
a MultiStatus of PropertyResponses. | public MultiStatus | getProperties(PropertyName names) Get the named properties of this resource. | public PropertyValue | getProperty(PropertyName name) Get the value of the given property for this resource. | public MultiStatus | getPropertyNames() Get the names of all properties for this resource. | public HTTPHeaders | getRequestContext() Get the request context for this resource. | public HTTPHeaders | getResponseContext() Get the response context for this resource. | public Document | getRevisionHistory() Get the revision history for a versioned resource. | public String | getRevisionId() Get the system-assigned revision id for this revision. | public int | getStatusCode() Get the status code corresponding to the last method execution. | public String | getStatusMessage() Get the status message corresponding to the last method execution. | public Enumeration | getSuccessors() Get the immediate successors of this revision. | public TargetSelector | getTargetSelector() Get the TargetSelector that identifies this resource revision. | public URL | getURL() Get the name that identifies this resource. | public String | getWorkingResourceId() Get the system-assigned working resource id for this revision.
Returns NULL if the resource is not versioned or is not checked out.
The working resource id must be unique for all working resources
of this revision. | public Enumeration | getWorkingResources() Get the current working resources of this revision. | protected void | initialize(URL url, TargetSelector targetSelector) Initialize this collection instance. | public boolean | isAutomaticallyVersioned() A resource can be automatically versioned on each method
that updates its state (content or properties). | public boolean | isCheckedOut(Activity activity) Return true if this revision is checked out in the given activity. | public boolean | isCollection() Returns true if this Resource is a collection. | public boolean | isLabeledWith(String label) | public boolean | isLocked() See if this resource is locked. | public boolean | isLockedByMe() Is this resource locked by the current authorized user? That is, does the
current user have sufficient locking access to modify this resource. | public boolean | isMutable() Return true if this revision is mutable. | boolean | isVersioned() Return true if this resource is a versioned resource. | public MultiStatus | lock(Document document) Exclusively write Lock this resource for all time.
detailed information about the lock status of this resource. | public MultiStatus | lock(String scope, String type, int timeout, Element owner) Lock this resource based on the given parameters. | public MultiStatus | move(String destinationURL) Move this resource to the destination URL. | public MultiStatus | move(String destinationURL, boolean overwrite, Vector propertiesToMove) Move this resource to the destination URL.
Partial results are possible, check the returned status for details
Parameters: destinationURL - the destination Parameters: overwrite - true implies overrite the destination if it exists Parameters: propertiesToMove - a collection of properties that must be moved orthe method will fail. | public byte[] | performWith(String args) This method treats this resource as a method or service, and sends its parameter to
this resource where it is handled in a resource-specific way. | public MultiStatus | refreshLock(String lockToken, int timeout) Refresh the lock on this resource by resetting the lock timeout.
The context must contain the proper authorization for the requesting
principal.
Parameters: lockToken - the lock token identifying the lock. Parameters: timeout - the new timeout in seconds. | public void | removeLabel(String label) Remove a label from a revision. | public MultiStatus | removeProperties(PropertyName[] names) Remove properties from a resource. | public void | removeProperty(PropertyName name) Remove a property from a resource. | public void | setContents(byte[] value) Set the contents of this resource. | public void | setContents(byte[] value, String mimetype) Set the contents of this resource. | public MultiStatus | setProperties(PropertyName[] names, Element[] values) Set properties of a resource. | public MultiStatus | setProperties(Document updates) Edit the properties of a resource. | public void | setProperty(PropertyName name, Element value) Set a property of a resource to a value. | public void | setRequestContext(HTTPHeaders value) Set the request context for this resource. | public void | setResponseContext(HTTPHeaders value) Set the response context for this resource. | public void | setStatusCode(int value) Set the status code corresponding to the last method execution. | public String | toString() Get a String representation of this resource. | public MultiStatus | unlock(String lockToken) Unlock the lock identified by the lockToken on this resource. |
XMLVersion | public static String XMLVersion(Code) | | The version of XML used by WebDAV
|
cachedContents | protected byte[] cachedContents(Code) | | |
defaultCharEncoding | public static String defaultCharEncoding(Code) | | |
defaultXMLEncoding | public static String defaultXMLEncoding(Code) | | The default charset encoding for XML documents and for storing
text/* MIME types on the server
|
Resource | public Resource()(Code) | | The default constructor. Should be rarely used.
|
Resource | public Resource(String url) throws WebDAVException(Code) | | Construct a Resource with the given URL. This is the constructor most clients
will use to construct and access Resources using WebDAV. The resource having
the url may not exist as this constructor does not access the resource from
the server. Use exists() or attmept to get the contents of the resource to
see if it exists. Other constructors are provided using parameters for the
various parts of the URL. See java.net.URLConnection for details. A ResourceFactory
may also be used to construct instances of a Resource.
Parameters: url - the URL of the resource. exception: com.ibm.webdav.WebDAVException - See Also: URLConnection See Also: com.ibm.webdav.ResourceFactory |
Resource | public Resource(String url, TargetSelector targetSelector) throws WebDAVException(Code) | | Construct a Resource with the given URL. The resource having
the url may not exist as this constructor does not access the resource from
the server. Use exists() or attmept to get the contents of the resource to
see if it exists. Other constructors are provided using parameters for the
various parts of the URL. See java.net.URLConnection for details. A ResourceFactory
may also be used to construct instances of a Resource.
Parameters: url - the URL of the resource. Parameters: targetSelector - the revision target selector for this Collection exception: java.io.IOException - See Also: URLConnection See Also: com.ibm.webdav.ResourceFactory |
Resource | public Resource(String protocol, String host, int port, String file) throws WebDAVException(Code) | | Create a Resource from the given URL components.
Parameters: protocol - the protocol to use, http:, rmi:, or iiop: Parameters: host - the name or IP addres of the server host. Using the client host name,or 'localhost' without a port uses local access with no RPC or server required. Parameters: port - the TCP port to use. HTTP uses 80 by default. Parameters: file - the resource URL relative to the server including any query string, etc. exception: WebDAVException - See Also: URLConnection See Also: com.ibm.webdav.ResourceFactory |
Resource | public Resource(String protocol, String host, String file) throws WebDAVException(Code) | | Create a Resource from the given URL components. This constructor uses the default
HTTP port.
Parameters: protocol - the protocol to use, http:, rmi:, or iiop: Parameters: host - the name or IP addres of the server host. Using the client host name,or 'localhost' without a port uses local access with no RPC or server required. Parameters: file - the resource URL relative to the server including any query string, etc. exception: com.ibm.webdav.WebDAVException - See Also: URLConnection See Also: com.ibm.webdav.ResourceFactory |
Resource | public Resource(URL url) throws WebDAVException(Code) | | Construct a Resource with the given URL. The resource having
the url may not exist as this constructor does not access the resource from
the server. Use exists() or attmept to get the contents of the resource to
see if it exists. Other constructors are provided using parameters for the
various parts of the URL. See java.net.URLConnection for details. A ResourceFactory
may also be used to construct instances of a Resource.
Parameters: url - the URL of the resource. exception: java.io.IOException - See Also: URLConnection See Also: com.ibm.webdav.ResourceFactory |
Resource | public Resource(URL url, TargetSelector targetSelector) throws WebDAVException(Code) | | Construct a Resource with the given URL. The resource having
the url may not exist as this constructor does not access the resource from
the server. Use exists() or attmept to get the contents of the resource to
see if it exists. Other constructors are provided using parameters for the
various parts of the URL. See java.net.URLConnection for details. A ResourceFactory
may also be used to construct instances of a Resource.
Parameters: url - the URL of the resource. Parameters: targetSelector - the revision target selector for this Collection exception: java.io.IOException - See Also: URLConnection See Also: com.ibm.webdav.ResourceFactory |
Resource | public Resource(URL context, String spec) throws WebDAVException(Code) | | Construct a Resource with the given URL specification in the given context. The resource having
the url may not exist as this constructor does not access the resource from
the server. Use exists() or attmept to get the contents of the resource to
see if it exists. Other constructors are provided using parameters for the
various parts of the URL. See java.net.URLConnection for details. A ResourceFactory
may also be used to construct instances of a Resource.
Parameters: context - a URL giving the context in which the spec is evaluated Parameters: spec - a URL whose missing parts are provided by the context exception: com.ibm.webdav.WebDAVException - See Also: URLConnection See Also: com.ibm.webdav.ResourceFactory |
addLabel | public void addLabel(String label) throws WebDAVException(Code) | | Add a label to this revision of a versioned resource. The
versioned resource must not already have the label on any
revision, and the label cannot be the same as any revision
id. The label must be removed from one revision before it
can be added to a different revision. The operation will
fail if the resource is not a versioned resource.
Labels are used to provide meaningful names that distinguish
revisions of versioned resources. They can be used in the revision
selection rule of the workspace to specify what revision should
be used in that workspace. A specific label may be used to override
the workspace to access revisions.
A revision does not need to be checked out to add a label.
Parameters: label - the label to add to the labels used to identifythis revision exception: com.ibm.webdav.WebDAVException - |
cancelCheckOut | public void cancelCheckOut() throws WebDAVException(Code) | | Cancel the checkout of this working resource, delete the
working resource, and remove any predecessor/successor
relationships created by checkout or merge. An exception
is raised if the resource is not currently checked out.
exception: com.ibm.webdav.WebDAVException - |
checkOut | public TargetSelector checkOut() throws WebDAVException(Code) | | Check out a resource in order to create a new working resource.
A resource is checked out in the context of the workspace, and
can only be checked out once in a given activity. The workspace
to use can be set in the request context. Checkout control
on versioned may be managed by locking the versioned resource or a
revision before checking out a revision.
CheckOut fails is the resource is not a versioned resource, is
currently checked out in the current activity, or the versioned
resource or revision is locked by another user. CheckOut also
fails if the current activity or workspace is locked. If the
versioned resource or revision is locked, the request context
must include a precondition containing the lock token.
If workspace is null, the server will return a workspace that
can be subsequently used to access the checked out working
resource.
the TargetSelector for this working resource exception: com.ibm.webdav.WebDAVException - |
checkOut | public TargetSelector checkOut(Workspace workspace) throws WebDAVException(Code) | | Check out a resource in order to create a new working resource.
A resource is checked out in the context of the workspace, and
can only be checked out once in a given activity. The workspace
to use can be set in the request context. Checkout control
on versioned may be managed by locking the versioned resource or a
revision before checking out a revision.
CheckOut fails is the resource is not a versioned resource, is
currently checked out in the current activity, or the versioned
resource or revision is locked by another user. CheckOut also
fails if the current activity or workspace is locked. If the
versioned resource or revision is locked, the request context
must include a precondition containing the lock token.
If workspace is null, the server will return a workspace that
can be subsequently used to access the checked out working
resource.
Parameters: workspace - the Workspace in which the revision is checked out. the TargetSelector for this working resource exception: com.ibm.webdav.WebDAVException - |
checkPoint | public void checkPoint(boolean makeCurrentTarget, boolean overwrite) throws WebDAVException(Code) | | Create a new revision of this resource, but keep it checked
out. If overwrite is false, create a new revision and set
the predecessor and successor relationships. If overwrite is
true, the revision is updated in place and the previous contents
are lost. Effectively, no new revision is created, and the revision
id now refers to the updated revision. Overwrite will fail if the
revision being overwritten is not mutable.
If makeCurrentTarget is true, this revision becomes the default target
for the versioned resource. Otherwise the current target is unchanged.
Parameters: makeCurrentTarget - true means the new revision becomes thetarget for the versioned resource. Otherwise the target is unchanged. Parameters: overwrite - ture means overwrite the existing revision,false means create a new revision. exception: com.ibm.webdav.WebDAVException - |
checkin | public void checkin(Activity activity, boolean makeCurrentTarget, boolean overwrite) throws WebDAVException(Code) | | Checkin a resource releasing it so other user agents may check
it out. If overwrite is false, create a new revision and set
the predecessor and successor relationships. If overwrite is
true, the revision is updated in place and the previous contents
are lost. Effectively, no new revision is created, and the revision
id now refers to the updated revision. Overwrite will fail if the
revision being overwritten is not mutable.
If makeCurrentTarget is true, this revision becomes the default target
for the versioned resource. Otherwise the current target is unchanged.
Parameters: activity - the activity associted with the changes made in this revision Parameters: makeCurrentTarget - true means the new revision becomes thetarget for the versioned resource. Otherwise the target is unchanged. Parameters: overwrite - ture means overwrite the existing revision,false means create a new revision. exception: com.ibm.webdav.WebDAVException - |
checkin | public void checkin(boolean makeCurrentTarget, boolean overwrite) throws WebDAVException(Code) | | Checkin a resource releasing it so other user agents may check
it out. If overwrite is false, create a new revision and set
the predecessor and successor relationships. If overwrite is
true, the revision is updated in place and the previous contents
are lost. Effectively, no new revision is created, and the revision
id now refers to the updated revision. Overwrite will fail if the
revision being overwritten is not mutable.
If makeCurrentTarget is true, this revision becomes the default target
for the versioned resource. Otherwise the current target is unchanged.
Parameters: makeCurrentTarget - true means the new revision becomes thetarget for the versioned resource. Otherwise the target is unchanged. Parameters: overwrite - ture means overwrite the existing revision,false means create a new revision. exception: com.ibm.webdav.WebDAVException - |
closeContentsOutputStream | public void closeContentsOutputStream() throws WebDAVException(Code) | | This method must be called after the client has completed writing to the contents
output stream that was obtained from getContentsOutputStream() .
exception: com.ibm.webdav.WebDAVException - |
closeContentsOutputStream | public void closeContentsOutputStream(String sContentType) throws WebDAVException(Code) | | Parameters: sContentType - |
copy | public MultiStatus copy(String destinationURL) throws WebDAVException(Code) | | Copy this resource to the destination URL. The destination resource must not already exist.
Partial results are possible, check the returned status for details.
Parameters: destinationURL - the destination the status of the copy operation for each resource copied exception: com.ibm.webdav.WebDAVException - |
copy | public MultiStatus copy(String destinationURL, boolean overwrite, Vector propertiesToCopy) throws WebDAVException(Code) | | Copy this resource to the destination URL.
Partial results are possible, check the returned status for details.
Parameters: destinationURL - the destination Parameters: overwrite - true implies overrite the destination if it exists Parameters: propertiesToCopy - a collection of properties that must be copied orthe method will fail. propertiesToCopy may have one of the following values:- null - ignore properties that cannot be copied
- empty collection - all properties must be copied or the method will fail
- a collection of URIs - a list of the properties that must be copiedor the method will fail
the status of the copy operation for each resource copied exception: com.ibm.webdav.WebDAVException - |
delete | public MultiStatus delete() throws WebDAVException(Code) | | Delete this resouce from the server. The actual effect of the delete operation is
determined by the underlying repository manager. The visible effect to WebDAV
is that the resource is no longer available.
a MultiStatus containing the status of the delete method on eacheffected resource. exception: com.ibm.webdav.WebDAVException - |
equals | public boolean equals(Resource resource) throws WebDAVException(Code) | | Two Resources are equal if they have the same URL. In this case, port
number -1 and port number 80 are considered the same port for equality
purposes.
true if the resources have URLs indicating the same server resource. exception: com.ibm.webdav.WebDAVException - |
exists | public boolean exists() throws WebDAVException(Code) | | See if the contents of this resource exists. A resource exists
if it has contents or state maintained by a server.
true if the contents exists, false otherwise exception: com.ibm.webdav.WebDAVException - |
getActiveLockFor | public ActiveLock getActiveLockFor(String principal) throws WebDAVException(Code) | | Get the active lock on this resource owned by the given principal if any.
NOTE: this method cannot be reliably implemented based on version 10 of
the WebDAV spec as an activelock element in a lockdiscovery does not contain
the authorization credentials of the owner of the lock. For now, this method
relies on an additional principal element in the activelock that contains
the required id. This is an IBM EXTENSTION. When WebDAV ACLs are introduced,
the principal will likely be added to the activelock element.
Parameters: principal - the authorization id of the requesting principal the active lock owned by that principal or null if the resource isnot locked by that principal. exception: com.ibm.webdav.WebDAVException - |
getActivity | public Activity getActivity() throws WebDAVException(Code) | | Get the activity this revision was created in. Returns null
for un-versioned resources or revisions that weren't
updated in an activity.
the Activity used to create this revision if any exception: com.ibm.webdav.WebDAVException - |
getContents | public byte[] getContents() throws WebDAVException(Code) | | Get the contents of this resource. This method does not decode text contents. The
caller should convert the result to a String using a character set based on the
contentType.
the contents as a byte array exception: com.ibm.webdav.WebDAVException - |
getContentsInputStream | public InputStream getContentsInputStream() throws WebDAVException(Code) | | Get an InputStream for accessing the contents of this resource. This method may provide
more efficient access for resources that have large contents. Clients may want to create
a Reader to perform appropriate character conversions on this stream.
an InputStream on the contents exception: com.ibm.webdav.WebDAVException - |
getContentsOutputStream | public OutputStream getContentsOutputStream() throws WebDAVException(Code) | | Get an OutputStream for setting the contents of this resource. This method may provide
more efficient access for resources that have large contents. Remember to call
closeContentsOutputStream() when all the data has been written.
an OutputStream to set the contents exception: com.ibm.webdav.WebDAVException - |
getMergeCandidates | public Enumeration getMergeCandidates() throws WebDAVException(Code) | | Return a list of activities on different lines of descent
for this revision that are candidates for merging. Returns
null if the resource is not a versioned resource.
an Enumeration of Activities that specify revisionson different lines of descent. exception: com.ibm.webdav.WebDAVException - |
getMergePredecessors | public Enumeration getMergePredecessors() throws WebDAVException(Code) | | Get the predecessors of this revision that were established
by merging changes from another activity. The list may be empty.
an Enumeration of Resources that are the mergepredecessors of this revision. exception: com.ibm.webdav.WebDAVException - |
getMetaInformation | public void getMetaInformation() throws WebDAVException(Code) | | This method can be used for obtaining meta-information about this resource without
actually reading the resource contents. This meta-information is maintained by the server
in addition to the resource properties.
After this call, the resource context has been updated and
getStatusCode() , getStatusMessage() , and getResponseContext()
as well as all the ResourceContext methods return updated values based on the current
state of the resource.
This methods corresponds to the HTTP HEAD method.
exception: com.ibm.webdav.WebDAVException - |
getMutableProperties | public Enumeration getMutableProperties() throws WebDAVException(Code) | | A resource may have a number of mutable properties. These are
properties that may change even when the resource is checked in.
Changes to these properties does not require a new revision.
an Enumeration of the mutable properties of this resource exception: com.ibm.webdav.WebDAVException - |
getOptions | public Element getOptions() throws WebDAVException(Code) | | Get the options for this resource. Versioning options
are established by the server and include:
- Mutable/immutable revisions
- Supports multiple activities
- Is automatically versioned
an XML Element containing the options forthis resource exception: com.ibm.webdav.WebDAVException - |
getPredecessor | public Resource getPredecessor() throws WebDAVException(Code) | | Get the predecessor of this revision. That is, get the
revision from which this revision was checked out.
Returns null if the Resource has no predecessor.
the predecessor of this revision or null if the revisionhas no successor. exception: com.ibm.webdav.WebDAVException - |
getRequestContext | public HTTPHeaders getRequestContext() throws WebDAVException(Code) | | Get the request context for this resource. The context contains information
used by methods on a resource when the method is called.
the ResourceContext providing information that controlsmethod execution. exception: com.ibm.webdav.WebDAVException - |
getResponseContext | public HTTPHeaders getResponseContext() throws WebDAVException(Code) | | Get the response context for this resource. The context contains information
returned from invocations of methods on a resource.
the ResourceContext providing information thatis returned by method execution. exception: com.ibm.webdav.WebDAVException - |
getRevisionHistory | public Document getRevisionHistory() throws WebDAVException(Code) | | Get the revision history for a versioned resource. The revision
history lists the revisions of a resource and their predecessors
and successors. The format of the document is given in section
Revision History. The document will not contain any revisions
if the resource is not versioned.
an XML document containing the revision history of theassociated versioned resource. exception: com.ibm.webdav.WebDAVException - |
getRevisionId | public String getRevisionId() throws WebDAVException(Code) | | Get the system-assigned revision id for this revision. This
revision name cannot be changed, and cannot be reused if
this revision is deleted. Returns NULL if the resource is
not versioned.
The revision id must be unique for the revision across all
time. Servers may choose to use an opaque identifier consisting
of a time stamp similar to UUIDs for lock tokens.
the revision id of this revision of a versioned resource exception: com.ibm.webdav.WebDAVException - |
getSuccessors | public Enumeration getSuccessors() throws WebDAVException(Code) | | Get the immediate successors of this revision. That is, get the revisions
that were created by checking out this revision.
The list may be empty.
an Enumeration of Resources that aresuccessors of this revision. exception: com.ibm.webdav.WebDAVException - |
getWorkingResourceId | public String getWorkingResourceId() throws WebDAVException(Code) | | Get the system-assigned working resource id for this revision.
Returns NULL if the resource is not versioned or is not checked out.
The working resource id must be unique for all working resources
of this revision. Servers may choose to use an opaque identifier consisting
of a time stamp similar to UUIDs for lock tokens.
the working resource id of this working resource of a revision ofa versioned resource exception: com.ibm.webdav.WebDAVException - |
getWorkingResources | public Enumeration getWorkingResources() throws WebDAVException(Code) | | Get the current working resources of this revision. Returns an
empty Enumeration if this revision has no current working resources.
Returns null if this resource is not a revision.
An Enumeration of current working resources of this VersionedResource exception: com.ibm.webdav.WebDAVException - |
isAutomaticallyVersioned | public boolean isAutomaticallyVersioned() throws WebDAVException(Code) | | A resource can be automatically versioned on each method
that updates its state (content or properties). Non-versioning
aware clients use automatic versioning to support updates. If
a resource is not automatically versioned, attempts to update
the revision without explicitly checking it out first will fail.
true if this resource is automatically versioned,false if not. exception: com.ibm.webdav.WebDAVException - |
isCheckedOut | public boolean isCheckedOut(Activity activity) throws WebDAVException(Code) | | Return true if this revision is checked out in the given activity.
The activity may be null to see if the revision was checked out
without using an activity.
Parameters: activity - the Activity to check for boolean return true if this revision is checked out in thegiven activity exception: com.ibm.webdav.WebDAVException - |
isLabeledWith | public boolean isLabeledWith(String label) throws WebDAVException(Code) | | Return true if any revision of this versioned resource is
labeled with the given label
Parameters: label - the label to check true if this revision is labeled with the given label exception: com.ibm.webdav.WebDAVException - |
isLockedByMe | public boolean isLockedByMe() throws WebDAVException(Code) | | Is this resource locked by the current authorized user? That is, does the
current user have sufficient locking access to modify this resource. The
method, like all methods that do modify the resource, must have a precondition
set in the context containing the lock token of the resource owned by this
user. The user is set in the request context using the authorization method.
true if this resource is locked by the principal in the contextsufficient to modify the resource. exception: com.ibm.webdav.WebDAVException - See Also: com.ibm.webdav.ResourceContext.authorization |
isMutable | public boolean isMutable() throws WebDAVException(Code) | | Return true if this revision is mutable. That is, it was checked
in as a mutable revision. Mutable revisions may be checked in
overwriting the contents of the revision with the contents of
the checked out working resource. This allows users to make
pdates that do not require a new revision.
An immutable revision can never be made mutable, but a new revision
can be. A mutable revision can be made immutable by checking it out
in place and checking it back is as immutable.
an XML document describing the differences betweenthe given resource and this resource exception: com.ibm.webdav.WebDAVException - |
isVersioned | boolean isVersioned() throws WebDAVException(Code) | | Return true if this resource is a versioned resource. A versioned
resource has multiple revisions and a revision history.
true if this resource is a versioned resource, false otherwise exception: com.ibm.webdav.WebDAVException - |
lock | public MultiStatus lock(Document document) throws WebDAVException(Code) | | Exclusively write Lock this resource for all time.
detailed information about the lock status of this resource. A MultiStatuscontaining lockdiscovery properties.An ActiveLock may be constructed by accessing the lockdiscovery element(s) of thereturned MultiStatus in order to obtain information about the lock. a MultiStatus containing a lockdiscovery property indicatingthe results of the lock operation. exception: com.ibm.webdav.WebDAVException - |
lock | public MultiStatus lock(String scope, String type, int timeout, Element owner) throws WebDAVException(Code) | | Lock this resource based on the given parameters. This allows control of
the lock scope (exclusive or shared) the lock type (write), owner information, etc.
Parameters: scope - the scope of the lock, exclusive or shared Parameters: type - the type of the lock, currently only write Parameters: timeout - the number of seconds before the lock times out or-1 for infinite timeout. Parameters: owner - an XML element containing useful information that can beused to identify the owner of the lock. An href to a home page, anemail address, phone number, etc. Can be null if no owner informationis provided. a MultiStatus containing a lockdiscovery property indicatingthe results of the lock operation. exception: com.ibm.webdav.WebDAVException - |
move | public MultiStatus move(String destinationURL) throws WebDAVException(Code) | | Move this resource to the destination URL.
The destination resource must not already exist.
Partial results are possible, check the returned status for details
Parameters: destinationURL - the destination the status of the move operation for each resource moved exception: com.ibm.webdav.WebDAVException - |
move | public MultiStatus move(String destinationURL, boolean overwrite, Vector propertiesToMove) throws WebDAVException(Code) | | Move this resource to the destination URL.
Partial results are possible, check the returned status for details
Parameters: destinationURL - the destination Parameters: overwrite - true implies overrite the destination if it exists Parameters: propertiesToMove - a collection of properties that must be moved orthe method will fail. propertiesToMove may have one of the following values:- null - ignore properties that cannot be moved
- empty collection - all properties must be moved or the method will fail
- a collection of URIs - a list of the properties that must be movedor the method will fail
the status of the move operation for each resource moved exception: com.ibm.webdav.WebDAVException - |
performWith | public byte[] performWith(String args) throws WebDAVException(Code) | | This method treats this resource as a method or service, and sends its parameter to
this resource where it is handled in a resource-specific way. For example,
sending data from an HTML form to a URL representing a Servlet or CGI script that processes
the form data to produce some result.
Parameters: args - a string representing the arguments to the method represented by this URL. Thearguments are in the form ?parameterName1=value1¶meterName2=value2... as specifiedfor URL queries. the results of sending the arguments to the URL exception: com.ibm.webdav.WebDAVException - |
refreshLock | public MultiStatus refreshLock(String lockToken, int timeout) throws WebDAVException(Code) | | Refresh the lock on this resource by resetting the lock timeout.
The context must contain the proper authorization for the requesting
principal.
Parameters: lockToken - the lock token identifying the lock. Parameters: timeout - the new timeout in seconds. -1 means infinite timeout. updated information about the lock status of this resource exception: com.ibm.webdav.WebDAVException - |
removeLabel | public void removeLabel(String label) throws WebDAVException(Code) | | Remove a label from a revision. An exception is raised
if the revision does not have this label.
A revision does not need to be checked out to add a label.
Parameters: label - the label to add to the labels used to identifythis revision exception: com.ibm.webdav.WebDAVException - |
setContents | public void setContents(byte[] value) throws WebDAVException(Code) | | Set the contents of this resource. This may create a new resource on the server,
or update the contents of an existing resource. Sufficient authorization is required
and administered by the target web server. For text/* MIME types, the caller should
be sure to convert Strings to byte codes using an acceptable charset, and to set
that charset in the request context so the server knows how to decode the byte
stream.
deprecated: Use the setContents method that takes content type as a parameter.
Parameters: value - the new contents for the resource exception: com.ibm.webdav.WebDAVException - |
setContents | public void setContents(byte[] value, String mimetype) throws WebDAVException(Code) | | Set the contents of this resource. This may create a new resource on the server,
or update the contents of an existing resource. Sufficient authorization is required
and administered by the target web server. For text/* MIME types, the caller should
be sure to convert Strings to byte codes using an acceptable charset, and to set
that charset in the request context so the server knows how to decode the byte
stream.
Parameters: value - the new contents for the resource Parameters: mimetype - the mimetype of the new contents exception: com.ibm.webdav.WebDAVException - |
setProperties | public MultiStatus setProperties(Document updates) throws WebDAVException(Code) | | Edit the properties of a resource. The updates must refer to a Document containing a WebDAV
DAV:propertyupdates element as the document root.
Parameters: updates - an XML Document containing DAV:propertyupdate elementsdescribing the edits to be made a MultiStatus indicating the status of the updates exception: com.ibm.webdav.WebDAVException - |
setRequestContext | public void setRequestContext(HTTPHeaders value) throws WebDAVException(Code) | | Set the request context for this resource. The context contains information
used by methods on a resource. This method is provided
for implementation reasons and would generally not be used by client
applications.
exception: com.ibm.webdav.WebDAVException - |
setResponseContext | public void setResponseContext(HTTPHeaders value) throws WebDAVException(Code) | | Set the response context for this resource. The context contains information
returned from methods on a resource. This method is provided
for implementation reasons and would generally not be used by client
applications.
exception: com.ibm.webdav.WebDAVException - |
toString | public String toString()(Code) | | Get a String representation of this resource.
the URL of this Resource |
unlock | public MultiStatus unlock(String lockToken) throws WebDAVException(Code) | | Unlock the lock identified by the lockToken on this resource. The request context
must contain the proper authorization.
Parameters: lockToken - the lock token obtained from the ActiveLock of a previous lock() or getLocks() . a MultiStatus containing any responses on resources that could notbe unlocked. exception: com.ibm.webdav.WebDAVException - |
|
|