org.guvnor.tools.utils.webdav
Interface IWebDavClient

All Known Implementing Classes:
WebDavClient

public interface IWebDavClient

Client methods for interacting with Guvnor through WebDav.


Method Summary
 IContext createContext()
          Convenience method for creating a request IContext.
 boolean createResource(String resource, InputStream is)
          Same as createResource(resource, is, true)
 boolean createResource(String resource, InputStream is, boolean overwrite)
          Creates a file in Guvnor through WebDav.
 void deleteResource(String resource)
          Deletes a resource in the repository.
 RemoteDAVClient getClient()
          Provides access to the underlying RemoteDAVClient.
 String getResourceContents(String resource)
          Get the contents of a resource from Guvnor through WebDav.
 IResponse getResourceInputStream(String resource)
          Get the InputStream of a resource from Guvnor through WebDav.
 String getResourceVersionContents(String resource, String version)
          Get the contents for a specific version of a resource from a Guvnor repository.
 IResponse getResourceVersionInputStream(String resource, String version)
          Get the InputStream for a specific version of a resource from Guvnor through WebDav.
 IResponse getResourceVersions(String resource)
          Gets all the version information for a resource
 Map<String,ResourceProperties> listDirectory(String path)
          Lists a directory (collection) in Guvnor through WebDav.
 void putResource(String resource, InputStream is)
          Write a file to Guvnor through WebDav.
 ResourceProperties queryProperties(String resource)
          Queries the server for properties of a given resource.
 void setSessionAuthenticator(IAuthenticator sessionAuthen)
          Tell the client to use the supplied authenticator, instead of one tied to the platform key ring.
 

Method Detail

setSessionAuthenticator

void setSessionAuthenticator(IAuthenticator sessionAuthen)
Tell the client to use the supplied authenticator, instead of one tied to the platform key ring. If the authenticator is null, the client defaults back to the platform key ring authenticator.

Parameters:
sessionAuthen - The authenticator

getClient

RemoteDAVClient getClient()
Provides access to the underlying RemoteDAVClient.

Returns:
The client associated with the current repository connection.

createContext

IContext createContext()
Convenience method for creating a request IContext.

Returns:
An instance of IContext

listDirectory

Map<String,ResourceProperties> listDirectory(String path)
                                             throws Exception
Lists a directory (collection) in Guvnor through WebDav.

Parameters:
path - The directory (collection) to list
Returns:
An association of directory content names and their properties
Throws:
Exception - Various WebDav errors can occur (See IResponse for details)

queryProperties

ResourceProperties queryProperties(String resource)
                                   throws Exception
Queries the server for properties of a given resource.

Parameters:
resource - The resource to get properties for
Returns:
The resource properties
Throws:
Exception - Various WebDav errors can occur (See IResponse for details)

getResourceContents

String getResourceContents(String resource)
                           throws Exception
Get the contents of a resource from Guvnor through WebDav.

Parameters:
resource - The address of the resource
Returns:
The contents of the resource
Throws:
Exception - Various WebDav errors can occur (See IResponse for details)

getResourceVersionContents

String getResourceVersionContents(String resource,
                                  String version)
                                  throws Exception
Get the contents for a specific version of a resource from a Guvnor repository.

Parameters:
resource - The address of the resource
version - The version number of the resource
Returns:
The contents of the resource
Throws:
Exception - Various WebDav errors can occur (See IResponse for details)

getResourceInputStream

IResponse getResourceInputStream(String resource)
                                 throws Exception
Get the InputStream of a resource from Guvnor through WebDav.

Parameters:
resource - The address of the resource
Returns:
The IResponse object, which the client must close
Throws:
Exception - Various WebDav errors can occur (See IResponse for details)

getResourceVersionInputStream

IResponse getResourceVersionInputStream(String resource,
                                        String version)
                                        throws Exception
Get the InputStream for a specific version of a resource from Guvnor through WebDav.

Parameters:
resource - The address of the resource
version - The version number of the resource
Returns:
The IResponse object, which the client must close
Throws:
Exception - Various WebDav errors can occur (See IResponse for details)

createResource

boolean createResource(String resource,
                       InputStream is)
                       throws Exception
Same as createResource(resource, is, true)

Throws:
Exception

createResource

boolean createResource(String resource,
                       InputStream is,
                       boolean overwrite)
                       throws Exception
Creates a file in Guvnor through WebDav.

Parameters:
resource - The path and name of the resource
is - A stream to the file contents
overwrite - Whether to overwrite the file if it already exists
Returns:
false if the file exists and overwrite = false
Throws:
Exception - Various WebDav errors can occur (See IResponse for details)

putResource

void putResource(String resource,
                 InputStream is)
                 throws Exception
Write a file to Guvnor through WebDav.

Parameters:
resource - The path and name of the resource
is - A stream to the file contents
Throws:
Exception - Various WebDav errors can occur (See IResponse for details)

getResourceVersions

IResponse getResourceVersions(String resource)
                              throws Exception
Gets all the version information for a resource

Parameters:
resource - The file to get version information about
Returns:
The IResponse object, which the client must close
Throws:
Exception - Various WebDav errors can occur (See IResponse for details)

deleteResource

void deleteResource(String resource)
                    throws Exception
Deletes a resource in the repository.

Parameters:
resource - The resource to delete
Throws:
Exception - Various WebDav errors can occur (See IResponse for details)


Copyright © 2001-2011 JBoss Inc.. All Rights Reserved.