public abstract class AbstractGetFilesAction extends ServiceableAction implements Contextualizable
Modifier and Type | Field and Description |
---|---|
protected Context |
_cocoonContext
The cocoon context
|
private SourceResolver |
_srcResolver
The source resolver
|
manager
EMPTY_MAP
Constructor and Description |
---|
AbstractGetFilesAction() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
_collection2JsonObject(TraversableSource folder,
TraversableSource root)
Convert collection to JSON object
|
protected String |
_getRelativePath(TraversableSource root,
TraversableSource file)
Get the relative path from root directory
|
protected Map<String,Object> |
_resource2JsonObject(TraversableSource file,
TraversableSource root)
Convert file to JSON object
|
Map |
act(Redirector redirector,
SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters) |
void |
contextualize(Context context) |
protected abstract String |
getRootURI(Request request)
Get the URI of root directory such as 'context://WEB-INF/param'
|
protected boolean |
isIgnoredSource(String fileName)
Test if the source has to be ignored
|
void |
service(ServiceManager smanager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected Context _cocoonContext
private SourceResolver _srcResolver
public AbstractGetFilesAction()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableAction
ServiceException
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
protected abstract String getRootURI(Request request)
request
- the requestprotected boolean isIgnoredSource(String fileName)
fileName
- The file nameprotected Map<String,Object> _collection2JsonObject(TraversableSource folder, TraversableSource root)
folder
- the folderroot
- the root directoryprotected Map<String,Object> _resource2JsonObject(TraversableSource file, TraversableSource root)
file
- the fileroot
- the root directoryprotected String _getRelativePath(TraversableSource root, TraversableSource file)
root
- The root directoryfile
- The file