Package org.opencastproject.rest
Class StaticResource
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.opencastproject.rest.StaticResource
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class StaticResource
extends javax.servlet.http.HttpServlet
A static resource for registration with the http service.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe base URL for these static resourcesprotected ClassLoaderThe classloader to use to search for the static resources.protected StringThe classpath to search for the static resourcesprotected booleanThe enable spa redirect flagprotected StringThe welcome file to redirect to, if only the alias is specified in the request -
Constructor Summary
ConstructorsConstructorDescriptionStaticResource(ClassLoader classloader, String classpath, String alias, String welcomeFile) Constructs a static resources.StaticResource(ClassLoader classloader, String classpath, String alias, String welcomeFile, boolean spaRedirect) Constructs a static resources. -
Method Summary
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, serviceMethods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
-
Field Details
-
classpath
The classpath to search for the static resources -
alias
The base URL for these static resources -
welcomeFile
The welcome file to redirect to, if only the alias is specified in the request -
spaRedirect
protected boolean spaRedirectThe enable spa redirect flag -
classloader
The classloader to use to search for the static resources.
-
-
Constructor Details
-
StaticResource
Constructs a static resources.- Parameters:
classpath- the classpath to the static resourcesalias- the URL aliaswelcomeFile- the default welcome file
-
StaticResource
public StaticResource(ClassLoader classloader, String classpath, String alias, String welcomeFile, boolean spaRedirect) Constructs a static resources.- Parameters:
classpath- the classpath to the static resourcesalias- the URL aliaswelcomeFile- the default welcome filespaRedirect- enable spa redirects
-
-
Method Details
-
activate
Activates the static resource when it is instantiated using Declarative Services.- Parameters:
componentProperties- the DS component context
-
getDefaultUrl
-
toString
-
doGet
public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException - Overrides:
doGetin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-