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
SimpleResourceHandlerProviderbased on source suffixes (mainly file extensions).
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<String>_supportedSuffixesThe 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 voidconfigure(Configuration configuration)protected abstract ResourceHandlercreateResourceHandler(String source)Actually creates theResourceHandler.ResourceHandlergetResourceHandler(String source)Returns the correspondingResourceHandleror null if none.
ReturnedResourceHandlershould 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:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
getResourceHandler
public ResourceHandler getResourceHandler(String source) throws Exception
Description copied from interface:ResourceHandlerProviderReturns the correspondingResourceHandleror null if none.
ReturnedResourceHandlershould be thread safe.- Specified by:
getResourceHandlerin 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.
-
-