org.apache.cocoon.components.repository
Class SourceRepositoryImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.repository.SourceRepositoryImpl
All Implemented Interfaces:
LogEnabled, Serviceable, ThreadSafe, SourceRepository

public class SourceRepositoryImpl
extends AbstractLogEnabled
implements Serviceable, ThreadSafe, SourceRepository

SourceRepository implementation.

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

Field Summary
 
Fields inherited from interface org.apache.cocoon.components.repository.SourceRepository
ROLE, STATUS_CONFLICT, STATUS_CREATED, STATUS_FORBIDDEN, STATUS_NO_CONTENT, STATUS_NOT_ALLOWED, STATUS_NOT_FOUND, STATUS_OK, STATUS_PRECONDITION_FAILED
 
Constructor Summary
SourceRepositoryImpl()
           
 
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)
          Removes 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.
 void service(ServiceManager manager)
           
 
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
 

Constructor Detail

SourceRepositoryImpl

public SourceRepositoryImpl()
Method Detail

service

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

save

public int save(String in,
                String out)
         throws IOException,
                SourceException
Description copied from interface: SourceRepository
Saves a Source by either creating a new one or overwriting the previous one.

Specified by:
save in interface SourceRepository
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

public int makeCollection(String location)
                   throws IOException,
                          SourceException
Description copied from interface: SourceRepository
Create a Source collection.

Specified by:
makeCollection in interface SourceRepository
Parameters:
location - the location of the source collection to create.
Returns:
a status code describing the exit status.
Throws:
IOException
SourceException

remove

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

Specified by:
remove in interface SourceRepository
Parameters:
location - the location of the source to remove.
Returns:
a http status code describing the exit status.
Throws:
IOException
SourceException

move

public int move(String from,
                String to,
                boolean recurse,
                boolean overwrite)
         throws IOException,
                SourceException
Description copied from interface: SourceRepository
Move a Source from one location to the other.

Specified by:
move in interface SourceRepository
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

public int copy(String from,
                String to,
                boolean recurse,
                boolean overwrite)
         throws IOException,
                SourceException
Description copied from interface: SourceRepository
Copy a Souce from one location to the other.

Specified by:
copy in interface SourceRepository
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.