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

    Fields
    Modifier and Type
    Field
    Description
    protected String
    The base URL for these static resources
    protected ClassLoader
    The classloader to use to search for the static resources.
    protected String
    The classpath to search for the static resources
    protected boolean
    The enable spa redirect flag
    protected String
    The welcome file to redirect to, if only the alias is specified in the request
  • Constructor Summary

    Constructors
    Constructor
    Description
    StaticResource(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

    Modifier and Type
    Method
    Description
    void
    activate(Map componentProperties)
    Activates the static resource when it is instantiated using Declarative Services.
    void
    doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
     
     
     

    Methods inherited from class javax.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service

    Methods inherited from class javax.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • classpath

      protected String classpath
      The classpath to search for the static resources
    • alias

      protected String alias
      The base URL for these static resources
    • welcomeFile

      protected String welcomeFile
      The welcome file to redirect to, if only the alias is specified in the request
    • spaRedirect

      protected boolean spaRedirect
      The enable spa redirect flag
    • classloader

      protected ClassLoader classloader
      The classloader to use to search for the static resources.
  • Constructor Details

    • StaticResource

      public StaticResource(ClassLoader classloader, String classpath, String alias, String welcomeFile)
      Constructs a static resources.
      Parameters:
      classpath - the classpath to the static resources
      alias - the URL alias
      welcomeFile - 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 resources
      alias - the URL alias
      welcomeFile - the default welcome file
      spaRedirect - enable spa redirects
  • Method Details

    • activate

      public void activate(Map componentProperties)
      Activates the static resource when it is instantiated using Declarative Services.
      Parameters:
      componentProperties - the DS component context
    • getDefaultUrl

      public String getDefaultUrl()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • doGet

      public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
      Overrides:
      doGet in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException