Package org.ametys.core.resources
Class JSResourceHandler
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.resources.SimpleResourceHandler
-
- org.ametys.core.resources.I18nTextResourceHandler
-
- org.ametys.core.resources.JSResourceHandler
-
- All Implemented Interfaces:
ResourceHandler
,LogEnabled
,Contextualizable
,Serviceable
- Direct Known Subclasses:
MinimizedJSResourceHandler
public class JSResourceHandler extends I18nTextResourceHandler
Resource handler for JavaScript files
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
_setExpiresToNoCache
Parameter to enable or not the expire 0 header.-
Fields inherited from class org.ametys.core.resources.I18nTextResourceHandler
_context
-
Fields inherited from class org.ametys.core.resources.SimpleResourceHandler
_objectModel, _parameters, _readForDownload, _requestedLocation, _resolver, _source
-
-
Constructor Summary
Constructors Constructor Description JSResourceHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getMimeType()
Return the mime type of the configured resource.Source
setup(String location, Map objectModel, Parameters par, boolean readForDownload)
Initialize the resource handler with a resource.-
Methods inherited from class org.ametys.core.resources.I18nTextResourceHandler
contextualize, generate, getKey, getLocale, service
-
Methods inherited from class org.ametys.core.resources.SimpleResourceHandler
getLastModified, getValidity
-
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.ResourceHandler
acceptRanges, generate, getLength, shouldUseSourceContentLength
-
-
-
-
Field Detail
-
_setExpiresToNoCache
protected boolean _setExpiresToNoCache
Parameter to enable or not the expire 0 header. Default to true
-
-
Constructor Detail
-
JSResourceHandler
public JSResourceHandler()
-
-
Method Detail
-
setup
public Source setup(String location, Map objectModel, Parameters par, boolean readForDownload) throws ProcessingException, IOException
Description copied from interface:ResourceHandler
Initialize the resource handler with a resource.- Specified by:
setup
in interfaceResourceHandler
- Overrides:
setup
in classI18nTextResourceHandler
- Parameters:
location
- The source uriobjectModel
- The object modelpar
- The parametersreadForDownload
- if the resource is to be downloaded and not rendered.- Returns:
- the resolved source
- Throws:
ProcessingException
- If an error occursIOException
- If an error occurs
-
getMimeType
public String getMimeType()
Description copied from interface:ResourceHandler
Return the mime type of the configured resource.- Specified by:
getMimeType
in interfaceResourceHandler
- Overrides:
getMimeType
in classSimpleResourceHandler
- Returns:
- The mime type.
-
-