Class AbstractGetFilesAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.plugins.core.ui.parameter.files.AbstractGetFilesAction
- All Implemented Interfaces:
Component
,Contextualizable
,LogEnabled
,Serviceable
,Action
- Direct Known Subclasses:
GetExtractionResultFilesAction
,GetParameterFileAction
,GetTempSkinResourcesAction
Abstract action for getting child files/folders of a local application folder
-
Field Summary
Modifier and TypeFieldDescriptionprotected Context
The cocoon contextprotected SourceResolver
The source resolverFields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_collection2JsonObject
(TraversableSource folder, TraversableSource root) Convert collection to JSON objectprotected String
_getRelativePath
(TraversableSource root, TraversableSource file) Get the relative path from root directory_resource2JsonObject
(TraversableSource file, TraversableSource root) Convert file to JSON objectact
(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
(TraversableSource source) Test if the source has to be ignoredvoid
service
(ServiceManager smanager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_cocoonContext
The cocoon context -
_srcResolver
The source resolver
-
-
Constructor Details
-
AbstractGetFilesAction
public AbstractGetFilesAction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception -
getRootURI
Get the URI of root directory such as 'context://WEB-INF/param'- Parameters:
request
- the request- Returns:
- The root URI
-
isIgnoredSource
Test if the source has to be ignored- Parameters:
source
- The source- Returns:
- true if the source has to be ignored
-
_collection2JsonObject
protected Map<String,Object> _collection2JsonObject(TraversableSource folder, TraversableSource root) Convert collection to JSON object- Parameters:
folder
- the folderroot
- the root directory- Returns:
- JSON object
-
_resource2JsonObject
Convert file to JSON object- Parameters:
file
- the fileroot
- the root directory- Returns:
- JSON object
-
_getRelativePath
Get the relative path from root directory- Parameters:
root
- The root directoryfile
- The file- Returns:
- The relative path
-