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
Resource handler for JavaScript files
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanParameter to enable or not the expire 0 header.Fields inherited from class org.ametys.core.resources.I18nTextResourceHandler
_contextFields inherited from class org.ametys.core.resources.SimpleResourceHandler
_objectModel, _parameters, _readForDownload, _requestedLocation, _resolver, _source -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the mime type of the configured resource.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, serviceMethods inherited from class org.ametys.core.resources.SimpleResourceHandler
getLastModified, getValidityMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.core.resources.ResourceHandler
acceptRanges, generate, getLength, shouldUseSourceContentLength
-
Field Details
-
_setExpiresToNoCache
Parameter to enable or not the expire 0 header. Default to true
-
-
Constructor Details
-
JSResourceHandler
public JSResourceHandler()
-
-
Method Details
-
setup
public Source setup(String location, Map objectModel, Parameters par, boolean readForDownload) throws ProcessingException, IOException Description copied from interface:ResourceHandlerInitialize the resource handler with a resource.- Specified by:
setupin interfaceResourceHandler- Overrides:
setupin 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
Description copied from interface:ResourceHandlerReturn the mime type of the configured resource.- Specified by:
getMimeTypein interfaceResourceHandler- Overrides:
getMimeTypein classSimpleResourceHandler- Returns:
- The mime type.
-