org.eclipse.webdav.client
Class LocalDAVClient

java.lang.Object
  extended by org.eclipse.webdav.client.DAVClient
      extended by org.eclipse.webdav.client.LocalDAVClient
All Implemented Interfaces:
IServer

public class LocalDAVClient
extends DAVClient

Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Field Summary
 
Fields inherited from class org.eclipse.webdav.client.DAVClient
davFactory
 
Constructor Summary
LocalDAVClient(LocalDAVClient localDAVClient)
          Creates a new local DAV client from a clone of the given local DAV client.
LocalDAVClient(WebDAVFactory webDAVFactory, IServer server)
          Creates a new local DAV client that talks to the server at the specified origin.
 
Method Summary
 IResponse baselineControl(ILocator locator, IContext context, Document body)
          Corresponds to the BASELINE-CONTROL method defined in the WebDAV Versioning Specification.
 IResponse bind(ILocator source, ILocator destination, IContext context)
          Binds the given source locator, to the given destination.
 IResponse checkin(ILocator locator, IContext context, Document body)
          Corresponds to the CHECKIN method defined in the WebDAV Versioning Specification.
 IResponse checkout(ILocator locator, IContext context, Document body)
          Corresponds to the CHECKOUT method defined in the WebDAV Versioning Specification.
protected  Object clone()
           
 IResponse copy(ILocator source, ILocator destination, IContext context, Document body)
          Copies the resource with the given locator, to the given destination.
 IResponse delete(ILocator locator, IContext context)
          Deletes the resource with the given locator.
 IResponse get(ILocator locator, IContext context)
          Gets the content of the resource with the given locator.
 IResponse head(ILocator locator, IContext context)
          Returns the message headers from a message send to the server.
 IResponse label(ILocator locator, IContext context, Document body)
          Corresponds to the LABEL method defined in the WebDAV Versioning Specification.
 IResponse lock(ILocator locator, IContext context, Document body)
          Locks the resource with the given locator.
 IResponse merge(ILocator locator, IContext context, Document body)
          Corresponds to the MERGE method defined in the WebDAV Versioning Specification.
 IResponse mkactivity(ILocator locator, IContext context, Document body)
          Creates an activity as specified by the given locator.
 IResponse mkcol(ILocator locator, IContext context, Document element)
          Creates the collection specified by the given locator.
 IResponse mkworkspace(ILocator locator, IContext context, Document body)
          Creates a workspace as specified by the given locator.
 IResponse move(ILocator source, ILocator destination, IContext context, Document body)
          Moves the resource with the given source locator, to the specified destination.
 IResponse options(ILocator locator, IContext context)
          Performs an options call to the server.
 IResponse post(ILocator locator, IContext context, InputStream input)
          Corresponds to the POST method as defined by the HTTP/1.1 specification.
 IResponse propfind(ILocator locator, IContext context, Document body)
          Performs a property find on the server.
 IResponse proppatch(ILocator locator, IContext context, Document body)
          Performs a property patch call on the server.
 IResponse put(ILocator locator, IContext context, InputStream input)
          Puts the given contents onto the server into the specified location.
 IResponse report(ILocator locator, IContext context, Document body)
          Corresponds to the REPORT method defined in the WebDAV Versioning Specification.
 IResponse trace(ILocator locator, IContext context)
          Does a trace call to the server.
 IResponse uncheckout(ILocator locator, IContext context)
          Corresponds to the UNCHECKOUT method defined in the WebDAV Versioning Specification.
 IResponse unlock(ILocator locator, IContext context)
          Unlocks the resource with the given locator.
 IResponse update(ILocator locator, IContext context, Document body)
          Performs an update call on the server.
 IResponse versionControl(ILocator locator, IContext context, Document body)
          Corresponds to the VERSION-CONTROL method defined in the WebDAV Versioning Specification.
 
Methods inherited from class org.eclipse.webdav.client.DAVClient
close, getDAVFactory, newContext
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalDAVClient

public LocalDAVClient(LocalDAVClient localDAVClient)
Creates a new local DAV client from a clone of the given local DAV client.

Parameters:
localDAVClient - the local DAV client to clone

LocalDAVClient

public LocalDAVClient(WebDAVFactory webDAVFactory,
                      IServer server)
Creates a new local DAV client that talks to the server at the specified origin. The origin server URL and the server must not be null.

Method Detail

baselineControl

public IResponse baselineControl(ILocator locator,
                                 IContext context,
                                 Document body)
                          throws IOException
Description copied from interface: IServer
Corresponds to the BASELINE-CONTROL method defined in the WebDAV Versioning Specification. The IResponse body is undefined.

Parameters:
locator - the location of the collection to put under baseline control.
context - key-value pairings defined by the user.
body - the DOM document for the DAV:baseline element.
Returns:
the response from the server; the client must send close() to the response when done with it.
Throws:
IOException - if there was a problem sending the request or receiving the response.
See Also:
IServer.baselineControl(ILocator, IContext, Document)

bind

public IResponse bind(ILocator source,
                      ILocator destination,
                      IContext context)
               throws IOException
Description copied from interface: IServer
Binds the given source locator, to the given destination. An overwrite boolean may be defined in the user context. Corresponds to the WebDAV method BIND defined in the WebDAV Bindings Specification (part of the Advanced Collections Protocol)

Parameters:
source - the location of the resource
destination - the location of the resource's desired parent
context - key-value pairings as set by the user
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.bind(ILocator, ILocator, IContext)

checkin

public IResponse checkin(ILocator locator,
                         IContext context,
                         Document body)
                  throws IOException
Description copied from interface: IServer
Corresponds to the CHECKIN method defined in the WebDAV Versioning Specification. The IResponse body is undefined.

Parameters:
locator - the location of the resource to check in.
context - key-value pairings defined by the user.
body - DOM document for DAV:checkin.
Returns:
the response from the server; the client must send close() to the response when done with it.
Throws:
IOException - if there was a problem sending the request or receiving the response.
See Also:
IServer.checkin(ILocator, IContext, Document)

checkout

public IResponse checkout(ILocator locator,
                          IContext context,
                          Document body)
                   throws IOException
Description copied from interface: IServer
Corresponds to the CHECKOUT method defined in the WebDAV Versioning Specification. The IResponse body is undefined.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
body - the XML elements that describe the parameters of the checkout in a DAV:checkout element.
Returns:
the response from the server; the client must send close() to the response when done with it.
Throws:
IOException - if there was a problem sending the request or receiving the response.
See Also:
IServer.checkout(ILocator, IContext, Document)

clone

protected Object clone()
Specified by:
clone in class DAVClient
See Also:
Object.clone()

copy

public IResponse copy(ILocator source,
                      ILocator destination,
                      IContext context,
                      Document body)
               throws IOException
Description copied from interface: IServer
Copies the resource with the given locator, to the given destination. Corresponds to the COPY method defined in the WebDAV Specification.

Parameters:
source - the location of the resource
destination - the desired location of the resource copy
context - key-value pairings as defined by the user
body - XML document describing the properties to copy
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.copy(ILocator, ILocator, IContext, Document)

delete

public IResponse delete(ILocator locator,
                        IContext context)
                 throws IOException
Description copied from interface: IServer
Deletes the resource with the given locator. Corresponds to the DELETE method defined in the HTTP/1.1 Specfication.

Parameters:
locator - the location of the resource
context - key-value pairings as defined by the user
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.delete(ILocator, IContext)

get

public IResponse get(ILocator locator,
                     IContext context)
              throws IOException
Description copied from interface: IServer
Gets the content of the resource with the given locator. Corresponds to the GET method defined in the HTTP/1.1 specification.

The input stream in the resulting response body should be closed by the user.

Parameters:
locator - the location of the resource
context - key-value pairings as defined by the user
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.get(ILocator, IContext)

head

public IResponse head(ILocator locator,
                      IContext context)
               throws IOException
Description copied from interface: IServer
Returns the message headers from a message send to the server. Corresponds to the HEAD method defined in the HTTP/1.1 specification.

Parameters:
locator - the location of the resource
context - key-value pairings as defined by the user
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.head(ILocator, IContext)

label

public IResponse label(ILocator locator,
                       IContext context,
                       Document body)
                throws IOException
Description copied from interface: IServer
Corresponds to the LABEL method defined in the WebDAV Versioning Specification. The IResponse body is undefined.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
body - DOM document for DAV:label element
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.label(ILocator, IContext, Document)

lock

public IResponse lock(ILocator locator,
                      IContext context,
                      Document body)
               throws IOException
Description copied from interface: IServer
Locks the resource with the given locator. Use the information contained in the context and DAV:lockinfo element. Corresponds to the LOCK method defined in the WebDAV specification.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
body - XML document containing lock information
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.lock(ILocator, IContext, Document)

merge

public IResponse merge(ILocator locator,
                       IContext context,
                       Document body)
                throws IOException
Description copied from interface: IServer
Corresponds to the MERGE method defined in the WebDAV Versioning Specification.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
body - XML document containing MERGE parameters
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.merge(ILocator, IContext, Document)

mkactivity

public IResponse mkactivity(ILocator locator,
                            IContext context,
                            Document body)
                     throws IOException
Description copied from interface: IServer
Creates an activity as specified by the given locator. Corresponds to the MKACTIVITY method as defined by the Delta-V Versioning Specification.

Parameters:
locator - the location of the new resource.
context - key-value pairings defined by the user.
body - an undefined XML body document.
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response.
See Also:
IServer.mkactivity(ILocator, IContext, Document)

mkcol

public IResponse mkcol(ILocator locator,
                       IContext context,
                       Document element)
                throws IOException
Description copied from interface: IServer
Creates the collection specified by the given locator. Corresponds to the MKCOL method as defined by the WebDAV specification.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
element - XML document containing properties
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.mkcol(ILocator, IContext, Document)

mkworkspace

public IResponse mkworkspace(ILocator locator,
                             IContext context,
                             Document body)
                      throws IOException
Description copied from interface: IServer
Creates a workspace as specified by the given locator. Corresponds to the MKWORKSPACE method as defined by the Delta-V Versioning Specification.

Parameters:
locator - the location of the new resource.
context - key-value pairings defined by the user.
body - an undefined XML body document.
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response.
See Also:
IServer.mkworkspace(ILocator, IContext, Document)

move

public IResponse move(ILocator source,
                      ILocator destination,
                      IContext context,
                      Document body)
               throws IOException
Description copied from interface: IServer
Moves the resource with the given source locator, to the specified destination. Corresponds to the MOVE method as defined by the WebDAV specification.

Parameters:
source - the location of the resource
destination - the desired location for the resource
context - key-value pairing defined by the user
body - XML document specifying the properties to move
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.move(ILocator, ILocator, IContext, Document)

options

public IResponse options(ILocator locator,
                         IContext context)
                  throws IOException
Description copied from interface: IServer
Performs an options call to the server. Answers a list of characteristics of the target resource.

Corresponds to the OPTIONS method as defined by the HTTP/1.1 Specification.

If the resource URL (in the locator) is "*", the server's general capabilities are queried.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.options(ILocator, IContext)

post

public IResponse post(ILocator locator,
                      IContext context,
                      InputStream input)
               throws IOException
Description copied from interface: IServer
Corresponds to the POST method as defined by the HTTP/1.1 specification.

The given input stream will be closed by the server after the contents have been consumed.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
input - the input stream containing the resource data
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.post(ILocator, IContext, InputStream)

propfind

public IResponse propfind(ILocator locator,
                          IContext context,
                          Document body)
                   throws IOException
Description copied from interface: IServer
Performs a property find on the server. Corresponds to the PROPFIND method as defined by the WebDAV specification.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
body - XML document as defined by the spec
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.propfind(ILocator, IContext, Document)

proppatch

public IResponse proppatch(ILocator locator,
                           IContext context,
                           Document body)
                    throws IOException
Description copied from interface: IServer
Performs a property patch call on the server. Corresponds to the PROPPATCH method as defined by the WebDAV specification.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
body - XML document as defined by the spec
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.proppatch(ILocator, IContext, Document)

put

public IResponse put(ILocator locator,
                     IContext context,
                     InputStream input)
              throws IOException
Description copied from interface: IServer
Puts the given contents onto the server into the specified location. Corresponds to the PUT method as defined by the HTTP/1.1 specification.

The given input stream will be closed by the server after the contents have been consumed.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
input - the input stream containing the resource data
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.put(ILocator, IContext, InputStream)

report

public IResponse report(ILocator locator,
                        IContext context,
                        Document body)
                 throws IOException
Description copied from interface: IServer
Corresponds to the REPORT method defined in the WebDAV Versioning Specification.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
body - XML document containing REPORT parameters
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.report(ILocator, IContext, Document)

trace

public IResponse trace(ILocator locator,
                       IContext context)
                throws IOException
Description copied from interface: IServer
Does a trace call to the server. Corresponds to the TRACE method as defined by the HTTP/1.1 specification.

The input stream in the response body should be closed by the user.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.trace(ILocator, IContext)

uncheckout

public IResponse uncheckout(ILocator locator,
                            IContext context)
                     throws IOException
Description copied from interface: IServer
Corresponds to the UNCHECKOUT method defined in the WebDAV Versioning Specification.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.uncheckout(ILocator, IContext)

unlock

public IResponse unlock(ILocator locator,
                        IContext context)
                 throws IOException
Description copied from interface: IServer
Unlocks the resource with the given locator. Corresponds to the UNLOCK method as defined by the WebDAV specification.

Parameters:
locator - the location of the resource
context - key-value pairings defined by the user
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.unlock(ILocator, IContext)

update

public IResponse update(ILocator locator,
                        IContext context,
                        Document body)
                 throws IOException
Description copied from interface: IServer
Performs an update call on the server. Corresponds to the UPDATE method as defined by the Delta-V specification.

Parameters:
locator - the location of the version-controlled resource.
context - key-value pairings defined by the client.
body - DAV:update XML document as defined by the spec.
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.update(ILocator, IContext, Document)

versionControl

public IResponse versionControl(ILocator locator,
                                IContext context,
                                Document body)
                         throws IOException
Description copied from interface: IServer
Corresponds to the VERSION-CONTROL method defined in the WebDAV Versioning Specification.

Parameters:
locator - the location of the versionable resource.
context - key-value pairings defined by the user.
body - the request body elements as a DOM document.
Returns:
the response from the server; the client must send close() to the response when done with it
Throws:
IOException - if there was a problem sending the request or receiving the response
See Also:
IServer.versionControl(ILocator, IContext, Document)


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.