Klasse ResourceProviderServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.teamapps.ux.servlet.resourceprovider.ResourceProviderServlet
Alle implementierten Schnittstellen:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class ResourceProviderServlet extends jakarta.servlet.http.HttpServlet
Siehe auch:
  • Feldübersicht

    Von Klasse geerbte Felder jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    protected void
    doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    protected void
    doHead(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    static String
    encodeURI(String string)
    URI-encode the given string using UTF-8.
    static String
    encodeURL(String string)
    URL-encode the given string using UTF-8.
    protected String
    getAttachmentName(jakarta.servlet.http.HttpServletRequest request, File file)
    Returns the file name to be used in Content-Disposition header.
    protected void
    handleNotFound(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
    Handles the case when the file is not found.
    static void
    setCacheHeaders(jakarta.servlet.http.HttpServletResponse response, long expires)
    Set the cache headers.
    static void
    setNoCacheHeaders(jakarta.servlet.http.HttpServletResponse response)
    Set the no-cache headers.

    Von Klasse geerbte Methoden jakarta.servlet.http.HttpServlet

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

    Von Klasse geerbte Methoden jakarta.servlet.GenericServlet

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

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • ResourceProviderServlet

      public ResourceProviderServlet(ResourceProvider resourceProvider)
  • Methodendetails

    • doHead

      protected void doHead(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException
      Setzt außer Kraft:
      doHead in Klasse jakarta.servlet.http.HttpServlet
      Löst aus:
      jakarta.servlet.ServletException
      IOException
    • doGet

      protected void doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException
      Setzt außer Kraft:
      doGet in Klasse jakarta.servlet.http.HttpServlet
      Löst aus:
      jakarta.servlet.ServletException
      IOException
    • handleNotFound

      protected void handleNotFound(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException
      Handles the case when the file is not found.

      The default implementation sends a HTTP 404 error.

      Parameter:
      request - The involved HTTP servlet request.
      response - The involved HTTP servlet response.
      Löst aus:
      IOException - When something fails at I/O level.
    • getAttachmentName

      protected String getAttachmentName(jakarta.servlet.http.HttpServletRequest request, File file)
      Returns the file name to be used in Content-Disposition header. This does not need to be URL-encoded as this will be taken care of.

      The default implementation returns File.getName().

      Parameter:
      request - The involved HTTP servlet request.
      file - The involved file.
      Gibt zurück:
      The file name to be used in Content-Disposition header.
    • encodeURL

      public static String encodeURL(String string)
      URL-encode the given string using UTF-8.
      Parameter:
      string - The string to be URL-encoded using UTF-8.
      Gibt zurück:
      The given string, URL-encoded using UTF-8, or null if null was given.
      Löst aus:
      UnsupportedOperationException - When this platform does not support UTF-8.
    • encodeURI

      public static String encodeURI(String string)
      URI-encode the given string using UTF-8. URIs (paths and filenames) have different encoding rules as compared to URL query string parameters. URLEncoder is actually only for www (HTML) form based query string parameter values (as used when a webbrowser submits a HTML form). URI encoding has a lot in common with URL encoding, but the space has to be %20 and some chars doesn't necessarily need to be encoded.
      Parameter:
      string - The string to be URI-encoded using UTF-8.
      Gibt zurück:
      The given string, URI-encoded using UTF-8, or null if null was given.
      Löst aus:
      UnsupportedOperationException - When this platform does not support UTF-8.
    • setCacheHeaders

      public static void setCacheHeaders(jakarta.servlet.http.HttpServletResponse response, long expires)

      Set the cache headers. If the expires argument is larger than 0 seconds, then the following headers will be set:

      • Cache-Control: public,max-age=[expiration time in seconds],must-revalidate
      • Expires: [expiration date of now plus expiration time in seconds]

      Else the method will delegate to setNoCacheHeaders(HttpServletResponse).

      Parameter:
      response - The HTTP servlet response to set the headers on.
      expires - The expire time in seconds (not milliseconds!).
    • setNoCacheHeaders

      public static void setNoCacheHeaders(jakarta.servlet.http.HttpServletResponse response)

      Set the no-cache headers. The following headers will be set:

      • Cache-Control: no-cache,no-store,must-revalidate
      • Expires: [expiration date of 0]
      • Pragma: no-cache
      Set the no-cache headers.
      Parameter:
      response - The HTTP servlet response to set the headers on.