org.eclipse.webdav.client
Class RemoteDAVClient

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

public class RemoteDAVClient
extends DAVClient

The ServerProxy class implements the IServer interface and represents a client's local proxy to a remote server. This object is used to talk with the server.

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
protected  HttpClient httpClient
           
 
Fields inherited from class org.eclipse.webdav.client.DAVClient
davFactory
 
Constructor Summary
RemoteDAVClient(RemoteDAVClient davClient)
          Creates a new remote DAV client from a clone of the given remote DAV client.
RemoteDAVClient(WebDAVFactory webDAVFactory, HttpClient httpClient)
          Creates a new remote DAV client.
 
Method Summary
 IResponse baselineControl(ILocator locator, IContext userContext, Document document)
          Corresponds to the BASELINE-CONTROL method defined in the WebDAV Versioning Specification.
 IResponse bind(ILocator source, ILocator destination, IContext userContext)
          Binds the given source locator, to the given destination.
 IResponse checkin(ILocator locator, IContext userContext, Document document)
          Corresponds to the CHECKIN method defined in the WebDAV Versioning Specification.
 IResponse checkout(ILocator locator, IContext userContext, Document body)
          Corresponds to the CHECKOUT method defined in the WebDAV Versioning Specification.
protected  Object clone()
           
 void close()
          Close down the client for futire API calls.
 IResponse copy(ILocator source, ILocator destination, IContext userContext, Document document)
          Copies the resource with the given locator, to the given destination.
 IResponse delete(ILocator locator, IContext userContext)
          Deletes the resource with the given locator.
 IResponse get(ILocator locator, IContext userContext)
          Gets the content of the resource with the given locator.
 HttpClient getHttpClient()
          Returns this DAV clients HTTP client.
 IResponse head(ILocator locator, IContext userContext)
          Returns the message headers from a message send to the server.
 IResponse label(ILocator locator, IContext userContext, Document document)
          Corresponds to the LABEL method defined in the WebDAV Versioning Specification.
 IResponse lock(ILocator locator, IContext userContext, Document document)
          Locks the resource with the given locator.
 IResponse merge(ILocator locator, IContext userContext, Document document)
          Corresponds to the MERGE method defined in the WebDAV Versioning Specification.
 IResponse mkactivity(ILocator locator, IContext userContext, Document document)
          Creates an activity as specified by the given locator.
 IResponse mkcol(ILocator locator, IContext userContext, Document document)
          Creates the collection specified by the given locator.
 IResponse mkworkspace(ILocator locator, IContext userContext, Document document)
          Creates a workspace as specified by the given locator.
 IResponse move(ILocator source, ILocator destination, IContext userContext, Document document)
          Moves the resource with the given source locator, to the specified destination.
 IResponse options(ILocator locator, IContext userContext)
          Performs an options call to the server.
 IResponse post(ILocator locator, IContext userContext, InputStream is)
          Corresponds to the POST method as defined by the HTTP/1.1 specification.
 IResponse propfind(ILocator locator, IContext userContext, Document document)
          Performs a property find on the server.
 IResponse proppatch(ILocator locator, IContext userContext, Document document)
          Performs a property patch call on the server.
 IResponse put(ILocator locator, IContext userContext, InputStream is)
          Puts the given contents onto the server into the specified location.
 IResponse report(ILocator locator, IContext userContext, Document document)
          Corresponds to the REPORT method defined in the WebDAV Versioning Specification.
 IResponse trace(ILocator locator, IContext userContext)
          Does a trace call to the server.
 IResponse uncheckout(ILocator locator, IContext userContext)
          Corresponds to the UNCHECKOUT method defined in the WebDAV Versioning Specification.
 IResponse unlock(ILocator locator, IContext userContext)
          Unlocks the resource with the given locator.
 IResponse update(ILocator locator, IContext userContext, Document body)
          Performs an update call on the server.
 IResponse versionControl(ILocator locator, IContext userContext, Document body)
          Corresponds to the VERSION-CONTROL method defined in the WebDAV Versioning Specification.
 
Methods inherited from class org.eclipse.webdav.client.DAVClient
getDAVFactory, newContext
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

httpClient

protected HttpClient httpClient
Constructor Detail

RemoteDAVClient

public RemoteDAVClient(RemoteDAVClient davClient)
Creates a new remote DAV client from a clone of the given remote DAV client.

Parameters:
davClient - the DAV client to clone

RemoteDAVClient

public RemoteDAVClient(WebDAVFactory webDAVFactory,
                       HttpClient httpClient)
Creates a new remote DAV client.

Parameters:
webDAVFactory -
Method Detail

baselineControl

public IResponse baselineControl(ILocator locator,
                                 IContext userContext,
                                 Document document)
                          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.
userContext - key-value pairings defined by the user.
document - 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 userContext)
               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
userContext - 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 userContext,
                         Document document)
                  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.
userContext - key-value pairings defined by the user.
document - 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 userContext,
                          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
userContext - 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()

close

public void close()
Close down the client for futire API calls. Once a client has been clsed then callers should not expect further API cals to be sucessful.

Overrides:
close in class DAVClient

copy

public IResponse copy(ILocator source,
                      ILocator destination,
                      IContext userContext,
                      Document document)
               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
userContext - key-value pairings as defined by the user
document - 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 userContext)
                 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
userContext - 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 userContext)
              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
userContext - 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)

getHttpClient

public HttpClient getHttpClient()
Returns this DAV clients HTTP client.


head

public IResponse head(ILocator locator,
                      IContext userContext)
               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
userContext - 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 userContext,
                       Document document)
                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
userContext - key-value pairings defined by the user
document - 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 userContext,
                      Document document)
               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
userContext - key-value pairings defined by the user
document - 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 userContext,
                       Document document)
                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
userContext - key-value pairings defined by the user
document - 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 userContext,
                            Document document)
                     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.
userContext - key-value pairings defined by the user.
document - 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 userContext,
                       Document document)
                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
userContext - key-value pairings defined by the user
document - 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 userContext,
                             Document document)
                      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.
userContext - key-value pairings defined by the user.
document - 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 userContext,
                      Document document)
               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
userContext - key-value pairing defined by the user
document - 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 userContext)
                  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
userContext - 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 userContext,
                      InputStream is)
               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
userContext - key-value pairings defined by the user
is - 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 userContext,
                          Document document)
                   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
userContext - key-value pairings defined by the user
document - 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 userContext,
                           Document document)
                    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
userContext - key-value pairings defined by the user
document - 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 userContext,
                     InputStream is)
              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
userContext - key-value pairings defined by the user
is - 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 userContext,
                        Document document)
                 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
userContext - key-value pairings defined by the user
document - 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 userContext)
                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
userContext - 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 userContext)
                     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
userContext - 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 userContext)
                 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
userContext - 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 userContext,
                        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.
userContext - 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 userContext,
                                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.
userContext - 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.