org.apache.cocoon.components.repository
Interface Repository

All Known Implementing Classes:
WebDAVRepository

public interface Repository

A repository interface intended to be used by flowscripts or corresponding wrapper components.


Method Summary
 boolean copy(String uri, String dest, boolean recurse, boolean overwrite)
          copy a resource
 boolean createResource(String uri, String content)
          create a new resource
 boolean exists(String uri)
          checks wether resource exists
 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 property helper
 RepositoryTransactionHelper getTransactionHelper()
          get a transaction helper
 RepositoryVersioningHelper getVersioningHelper()
          get a versioning helper
 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 setCredentials(CredentialsToken credentials)
          set the credentials to be used against the repository
 

Method Detail

getContentString

String getContentString(String uri)
                        throws ProcessingException
get content as String

Parameters:
uri - the uri of the resource.
Returns:
the content as a String.
Throws:
ProcessingException

getContentStream

InputStream getContentStream(String uri)
                             throws ProcessingException
get content as Stream

Parameters:
uri - the uri of the resource.
Returns:
the content as a InputStream.
Throws:
ProcessingException

getContentDOM

Document getContentDOM(String uri)
                       throws ProcessingException
get content as DOM

Parameters:
uri - the uri of the resource.
Returns:
the content as a W3C Document object.
Throws:
ProcessingException

saveContent

boolean saveContent(String uri,
                    String content)
                    throws ProcessingException
save content

Parameters:
uri - the uri of the resource.
content - the to be saved content given as a String.
Returns:
a boolean indicating success.
Throws:
ProcessingException

saveContent

boolean saveContent(String uri,
                    Node node)
                    throws ProcessingException
save content

Parameters:
uri - the uri of the resource.
node - the to be saved content given as a W3C Node object.
Returns:
a boolean indicating success.
Throws:
ProcessingException

saveContent

boolean saveContent(String uri,
                    Source source)
                    throws ProcessingException
save content

Parameters:
uri - the uri of the resource.
source - the to be saved content given as a Excalibur Source object.
Returns:
a boolean indicating success.
Throws:
ProcessingException

createResource

boolean createResource(String uri,
                       String content)
                       throws ProcessingException
create a new resource

Parameters:
uri - the uri of the resource.
content - the content to initialize the resource with.
Returns:
a boolean indicating success.
Throws:
ProcessingException

copy

boolean copy(String uri,
             String dest,
             boolean recurse,
             boolean overwrite)
             throws ProcessingException
copy a resource

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.
Throws:
ProcessingException

move

boolean move(String uri,
             String dest,
             boolean recurse,
             boolean overwrite)
             throws ProcessingException
move a resource

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.
Throws:
ProcessingException

remove

boolean remove(String uri)
               throws ProcessingException
remove resource

Parameters:
uri - the uri of the resource.
Returns:
a boolean indicating success.
Throws:
ProcessingException

exists

boolean exists(String uri)
               throws ProcessingException
checks wether resource exists

Parameters:
uri - the uri of the document.
Returns:
a boolean indicating existance of the resource.
Throws:
ProcessingException

makeCollection

boolean makeCollection(String uri,
                       boolean recursive)
                       throws ProcessingException
make collection

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.
Throws:
ProcessingException

getPropertyHelper

RepositoryPropertyHelper getPropertyHelper()
get a property helper

Returns:
the property helper. Returns null if the Repository does not support properties.

getTransactionHelper

RepositoryTransactionHelper getTransactionHelper()
get a transaction helper

Returns:
a transaction helper. Returns null if the Repository does neither support transactions nor locks.

getVersioningHelper

RepositoryVersioningHelper getVersioningHelper()
get a versioning helper

Returns:
a versioning helper. Returns null if the Repository does not support versioning.

getCredentials

CredentialsToken getCredentials()
get the credentials used against the repository

Returns:
the credentials in use.

setCredentials

void setCredentials(CredentialsToken credentials)
set the credentials to be used against the repository

Parameters:
credentials - the credentials to use.


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