org.apache.cocoon.components.repository.impl
Class WebDAVRepository

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.repository.impl.WebDAVRepository
All Implemented Interfaces:
Disposable, Initializable, Component, Configurable, LogEnabled, Serviceable, Repository

public class WebDAVRepository
extends AbstractLogEnabled
implements Repository, Serviceable, Configurable, Initializable, Disposable, Component

A repository implementation for WebDAV.


Field Summary
static String REPO_BASE_CONF
          The name of the repository location configuration element
 
Constructor Summary
WebDAVRepository()
           
 
Method Summary
 void configure(Configuration configuration)
           
 boolean copy(String uri, String dest, boolean recurse, boolean overwrite)
          copy a resource
 boolean createResource(String uri, String content)
          create a new resource
 void dispose()
           
 boolean exists(String uri)
          checks wether resource exists
 String getAbsoluteURI(String uri)
          get the absolute URI of a given path
 Document getContentDOM(String uri)
          get content as DOM
 InputStream getContentStream(String uri)
          get content as Stream
 String getContentString(String uri)
          get content as String
 CredentialsToken getCredentials()
          get the credentials used against the repository
 RepositoryPropertyHelper getPropertyHelper()
          get a WebDAV property helper
 RepositoryTransactionHelper getTransactionHelper()
          get a WebDAV transaction helper
 RepositoryVersioningHelper getVersioningHelper()
          get a WebDAV versioning helper
 void initialize()
           
 boolean makeCollection(String uri, boolean recursive)
          make collection
 boolean move(String uri, String dest, boolean recurse, boolean overwrite)
          move a resource
 boolean remove(String uri)
          remove resource
 boolean saveContent(String uri, Node node)
          save content
 boolean saveContent(String uri, Source source)
          save content
 boolean saveContent(String uri, String content)
          save content
 void service(ServiceManager manager)
           
 void setCredentials(CredentialsToken credentials)
          set the credentials to be used against the repository
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPO_BASE_CONF

public static final String REPO_BASE_CONF
The name of the repository location configuration element

See Also:
Constant Field Values
Constructor Detail

WebDAVRepository

public WebDAVRepository()
Method Detail

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Specified by:
configure in interface Configurable
Throws:
ConfigurationException

initialize

public void initialize()
                throws Exception
Specified by:
initialize in interface Initializable
Throws:
Exception

dispose

public void dispose()
Specified by:
dispose in interface Disposable

getContentString

public String getContentString(String uri)
                        throws ProcessingException
Description copied from interface: Repository
get content as String

Specified by:
getContentString in interface Repository
Parameters:
uri - the uri of the resource.
Returns:
the content as a String.
Throws:
ProcessingException

getContentStream

public InputStream getContentStream(String uri)
                             throws ProcessingException
Description copied from interface: Repository
get content as Stream

Specified by:
getContentStream in interface Repository
Parameters:
uri - the uri of the resource.
Returns:
the content as a InputStream.
Throws:
ProcessingException

getContentDOM

public Document getContentDOM(String uri)
                       throws ProcessingException
Description copied from interface: Repository
get content as DOM

Specified by:
getContentDOM in interface Repository
Parameters:
uri - the uri of the resource.
Returns:
the content as a W3C Document object.
Throws:
ProcessingException

saveContent

public boolean saveContent(String uri,
                           String content)
Description copied from interface: Repository
save content

Specified by:
saveContent in interface Repository
Parameters:
uri - the uri of the resource.
content - the to be saved content given as a String.
Returns:
a boolean indicating success.

saveContent

public boolean saveContent(String uri,
                           Node node)
Description copied from interface: Repository
save content

Specified by:
saveContent in interface Repository
Parameters:
uri - the uri of the resource.
node - the to be saved content given as a W3C Node object.
Returns:
a boolean indicating success.

saveContent

public boolean saveContent(String uri,
                           Source source)
Description copied from interface: Repository
save content

Specified by:
saveContent in interface Repository
Parameters:
uri - the uri of the resource.
source - the to be saved content given as a Excalibur Source object.
Returns:
a boolean indicating success.

createResource

public boolean createResource(String uri,
                              String content)
Description copied from interface: Repository
create a new resource

Specified by:
createResource in interface Repository
Parameters:
uri - the uri of the resource.
content - the content to initialize the resource with.
Returns:
a boolean indicating success.

exists

public boolean exists(String uri)
Description copied from interface: Repository
checks wether resource exists

Specified by:
exists in interface Repository
Parameters:
uri - the uri of the document.
Returns:
a boolean indicating existance of the resource.

copy

public boolean copy(String uri,
                    String dest,
                    boolean recurse,
                    boolean overwrite)
Description copied from interface: Repository
copy a resource

Specified by:
copy in interface Repository
Parameters:
uri - the uri of the resource.
dest - the destination of the copy.
recurse - if true recursively creates parent collections if not existant
overwrite - whether to overwrite the destination if it exists.
Returns:
a boolean indicating success.

move

public boolean move(String uri,
                    String dest,
                    boolean recurse,
                    boolean overwrite)
Description copied from interface: Repository
move a resource

Specified by:
move in interface Repository
Parameters:
uri - the uri of the resource.
dest - the destination of the move.
recurse - if true recursively creates parent collections if not existant
overwrite - whether to overwrite the destination if it exists.
Returns:
a boolean indicating success.

remove

public boolean remove(String uri)
Description copied from interface: Repository
remove resource

Specified by:
remove in interface Repository
Parameters:
uri - the uri of the resource.
Returns:
a boolean indicating success.

makeCollection

public boolean makeCollection(String uri,
                              boolean recursive)
Description copied from interface: Repository
make collection

Specified by:
makeCollection in interface Repository
Parameters:
uri - the uri of the collection.
recursive - a boolean indicating wether the operation should fail if the parent collection does not exist or wether the complete path should be created.
Returns:
a boolean indicating success.

getPropertyHelper

public RepositoryPropertyHelper getPropertyHelper()
get a WebDAV property helper

Specified by:
getPropertyHelper in interface Repository
Returns:
a WebDAV property helper.

getTransactionHelper

public RepositoryTransactionHelper getTransactionHelper()
get a WebDAV transaction helper

Specified by:
getTransactionHelper in interface Repository
Returns:
a WebDAV transaction helper.

getVersioningHelper

public RepositoryVersioningHelper getVersioningHelper()
get a WebDAV versioning helper

Specified by:
getVersioningHelper in interface Repository
Returns:
a WebDAV versioning helper.

getAbsoluteURI

public String getAbsoluteURI(String uri)
get the absolute URI of a given path

Parameters:
uri - the uri to get a versioning helper for.
Returns:
the absolute URI.

getCredentials

public CredentialsToken getCredentials()
Description copied from interface: Repository
get the credentials used against the repository

Specified by:
getCredentials in interface Repository
Returns:
the credentials in use.

setCredentials

public void setCredentials(CredentialsToken credentials)
Description copied from interface: Repository
set the credentials to be used against the repository

Specified by:
setCredentials in interface Repository
Parameters:
credentials - the credentials to use.


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.