org.apache.cocoon.components.repository
Interface SourceRepository

All Known Implementing Classes:
SourceRepositoryImpl

public interface SourceRepository

A stateless utility service intended to be used by flowscripts to help them with persistent operations on sources.

Each operation returns a status code that is based on RFC 2518 (WebDAV).

Version:
$Id: SourceRepository.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Field Summary
static String ROLE
           
static int STATUS_CONFLICT
          Status CONFLICT (409).
static int STATUS_CREATED
          Status CREATED (201).
static int STATUS_FORBIDDEN
          Status FORBIDDEN (403).
static int STATUS_NO_CONTENT
          Status NO_CONTENT (204).
static int STATUS_NOT_ALLOWED
          Status NOT_ALLOWED (405).
static int STATUS_NOT_FOUND
          Status NOT_FOUND (404).
static int STATUS_OK
          Status OK (200).
static int STATUS_PRECONDITION_FAILED
          Status PRECONDITION_FAILED (412)
 
Method Summary
 int copy(String from, String to, boolean recurse, boolean overwrite)
          Copy a Souce from one location to the other.
 int makeCollection(String location)
          Create a Source collection.
 int move(String from, String to, boolean recurse, boolean overwrite)
          Move a Source from one location to the other.
 int remove(String location)
          Deletes a Source and all of its descendants.
 int save(String in, String out)
          Saves a Source by either creating a new one or overwriting the previous one.
 

Field Detail

ROLE

static final String ROLE

STATUS_OK

static final int STATUS_OK
Status OK (200).

See Also:
Constant Field Values

STATUS_CREATED

static final int STATUS_CREATED
Status CREATED (201).

See Also:
Constant Field Values

STATUS_NO_CONTENT

static final int STATUS_NO_CONTENT
Status NO_CONTENT (204).

See Also:
Constant Field Values

STATUS_FORBIDDEN

static final int STATUS_FORBIDDEN
Status FORBIDDEN (403).

See Also:
Constant Field Values

STATUS_NOT_FOUND

static final int STATUS_NOT_FOUND
Status NOT_FOUND (404).

See Also:
Constant Field Values

STATUS_NOT_ALLOWED

static final int STATUS_NOT_ALLOWED
Status NOT_ALLOWED (405).

See Also:
Constant Field Values

STATUS_CONFLICT

static final int STATUS_CONFLICT
Status CONFLICT (409).

See Also:
Constant Field Values

STATUS_PRECONDITION_FAILED

static final int STATUS_PRECONDITION_FAILED
Status PRECONDITION_FAILED (412)

See Also:
Constant Field Values
Method Detail

save

int save(String in,
         String out)
         throws IOException,
                SourceException
Saves a Source by either creating a new one or overwriting the previous one.

Parameters:
in - the Source location to read from.
out - the Source location to write to.
Returns:
a status code describing the exit status.
Throws:
IOException
SourceException

makeCollection

int makeCollection(String location)
                   throws IOException,
                          SourceException
Create a Source collection.

Parameters:
location - the location of the source collection to create.
Returns:
a status code describing the exit status.
Throws:
IOException
SourceException

remove

int remove(String location)
           throws IOException,
                  SourceException
Deletes a Source and all of its descendants.

Parameters:
location - the location of the source to delete.
Returns:
a status code describing the exit status.
Throws:
IOException
SourceException

move

int move(String from,
         String to,
         boolean recurse,
         boolean overwrite)
         throws IOException,
                SourceException
Move a Source from one location to the other.

Parameters:
from - the source location.
to - the destination location.
recurse - whether to move all the source descendents also.
overwrite - whether to overwrite the destination source if it exists.
Returns:
a status code describing the exit status.
Throws:
IOException
SourceException

copy

int copy(String from,
         String to,
         boolean recurse,
         boolean overwrite)
         throws IOException,
                SourceException
Copy a Souce from one location to the other.

Parameters:
from - the source location.
to - the destination location.
recurse - whether to move all the source descendents also.
overwrite - whether to overwrite the destination source if it exists.
Returns:
a status code describing the exit status.
Throws:
IOException
SourceException


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