Package org.ametys.core.resources
Class AbstractSimpleResourceHandlerProvider
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.resources.AbstractResourceHandlerProvider
-
- org.ametys.core.resources.AbstractSimpleResourceHandlerProvider
-
- All Implemented Interfaces:
ResourceHandlerProvider
,LogEnabled
,Prioritizable
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
CssResourceHandlerProvider
,CSSSourceMapResourceHandlerProvider
,ImageResourceHandlerProvider
,JSResourceHandlerProvider
,JSSourceMapResourceHandlerProvider
,MinimizedCSSResourceHandlerProvider
,MinimizedJSResourceHandlerProvider
,PdfCoverResourceHandlerProvider
,UncompiledSassResourceHandlerProvider
public abstract class AbstractSimpleResourceHandlerProvider extends AbstractResourceHandlerProvider implements Configurable
SimpleResourceHandlerProvider
based on source suffixes (mainly file extensions).
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<String>
_supportedSuffixes
The supported suffixes-
Fields inherited from class org.ametys.core.resources.AbstractResourceHandlerProvider
_context, _manager
-
Fields inherited from interface org.ametys.core.resources.ResourceHandlerProvider
MAX_PRIORITY, MIN_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description AbstractSimpleResourceHandlerProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
configure(Configuration configuration)
protected abstract ResourceHandler
createResourceHandler(String source)
Actually creates theResourceHandler
.ResourceHandler
getResourceHandler(String source)
Returns the correspondingResourceHandler
or null if none.
ReturnedResourceHandler
should be thread safe.-
Methods inherited from class org.ametys.core.resources.AbstractResourceHandlerProvider
contextualize, service, setup
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.core.resources.ResourceHandlerProvider
getPriority
-
-
-
-
Field Detail
-
_supportedSuffixes
protected Set<String> _supportedSuffixes
The supported suffixes
-
-
Constructor Detail
-
AbstractSimpleResourceHandlerProvider
public AbstractSimpleResourceHandlerProvider()
-
-
Method Detail
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getResourceHandler
public ResourceHandler getResourceHandler(String source) throws Exception
Description copied from interface:ResourceHandlerProvider
Returns the correspondingResourceHandler
or null if none.
ReturnedResourceHandler
should be thread safe.- Specified by:
getResourceHandler
in interfaceResourceHandlerProvider
- Parameters:
source
- the requested resource.- Returns:
- a ResourceHandler able to process the resource.
- Throws:
Exception
- if an error occurs during ResourceHandler creation.
-
createResourceHandler
protected abstract ResourceHandler createResourceHandler(String source)
Actually creates theResourceHandler
.- Parameters:
source
- the requested resource.- Returns:
- the created
ResourceHandler
.
-
-