Package de.xima.fc.servlet.resource
Class APluginStaticResourceServletAction
- java.lang.Object
-
- de.xima.fc.servlet.resource.APluginStaticResourceServletAction
-
- All Implemented Interfaces:
INameProviding
,ITransferable
,INamedUiElement
,IFCPlugin
,IPluginServletAction
,IPluginStaticResourceServletAction
,Serializable
public abstract class APluginStaticResourceServletAction extends Object implements IPluginStaticResourceServletAction
Base class forIPluginServletAction
which provides a basic implementation for a servlet action that provides static resources. In addition toIPluginServletAction
, this abstract base class also stores the version of the plugin and uses that as theresource's ETag
. For non-stable versions, the current timestamp is used to bust the cache.- Since:
- 8.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
IPluginStaticResourceServletAction
, Serialized Form
-
-
Field Summary
-
Fields inherited from interface de.xima.fc.plugin.interfaces.IFCPlugin
CONFIG_FILENAME
-
Fields inherited from interface de.xima.fc.interfaces.INamedUiElement
ATTR_DISPLAY_NAME
-
Fields inherited from interface de.xima.fc.entities.interfaces.INameProviding
ATTR_NAME, COL_NAME
-
-
Constructor Summary
Constructors Constructor Description APluginStaticResourceServletAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IPluginServletActionRetVal
execute(IPluginServletActionParams args)
The main method of this plugin.ETagUtil.ETag
getResourceTag(String internalPath)
Gets the tag of the requested resource path.void
initialize(IPluginInitializeData initializeData)
Callback method that is invoked when this plugin is initialized.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.plugin.interfaces.IFCPlugin
getDescription, getDescription, getDisplayName, getName, initPlugin, install, shutdown, shutdown, uninstall, validateConfigurationData
-
Methods inherited from interface de.xima.fc.servlet.resource.IPluginStaticResourceServletAction
findContentType, getPathParam, isPathSupported, readResource, respondMissingPath, respondResourceFound, respondResourceNotFound, respondServerError, respondUnsupportedPath, toInternalPath
-
-
-
-
Method Detail
-
execute
public final IPluginServletActionRetVal execute(IPluginServletActionParams args) throws FCPluginException
Description copied from interface:IPluginServletAction
The main method of this plugin.When any exception other than
FCPluginException
is thrown, a generic HTML error page is returned to the client.- Specified by:
execute
in interfaceIPluginServletAction
- Specified by:
execute
in interfaceIPluginStaticResourceServletAction
- Parameters:
args
- The parameters this plugin may make use of. Contains for example the URL parameters, the data of theHttpSession
or the currentuser
.- Returns:
- The HTTP response code and the data to be sent as the response.
- Throws:
FCPluginException
- May be thrown when this plugin cannot handle the request. When this exception is thrown, a404
HTTP response is returned to the client.
-
getResourceTag
public ETagUtil.ETag getResourceTag(String internalPath)
Description copied from interface:IPluginStaticResourceServletAction
Gets the tag of the requested resource path. The tag is used for caching. As long as the tag does not change, the resource content is not sent again to clients that already have the resource.- Specified by:
getResourceTag
in interfaceIPluginStaticResourceServletAction
- Parameters:
internalPath
- Path to check.- Returns:
- The (version) tag of the given resource path.
-
initialize
public void initialize(IPluginInitializeData initializeData) throws FCPluginException
Description copied from interface:IFCPlugin
Callback method that is invoked when this plugin is initialized.- Specified by:
initialize
in interfaceIFCPlugin
- Parameters:
initializeData
-IPluginInitializeData
- Throws:
FCPluginException
- May be thrown when an error occurred during the initialization process. When an error is thrown, this plugin will be deactivated and not put into service.
-
-