Class BambooDefaultServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.catalina.servlets.DefaultServlet
com.atlassian.bamboo.plugin.servlet.BambooDefaultServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class BambooDefaultServlet extends org.apache.catalina.servlets.DefaultServlet
Default static resource serving servlet that only serves files from allowed paths or files listed in the allowed files list.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.catalina.servlets.DefaultServlet

    org.apache.catalina.servlets.DefaultServlet.CompressionFormat, org.apache.catalina.servlets.DefaultServlet.Range
  • Field Summary

    Fields inherited from class org.apache.catalina.servlets.DefaultServlet

    BUFFER_SIZE, compressionFormats, contextXsltFile, debug, fileEncoding, FULL, globalXsltFile, input, listings, localXsltFile, mimeSeparation, output, readmeFile, readOnly, resources, sendfileSize, showServerInfo, sm, sortListings, sortManager, useAcceptRanges
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Handles HTTP GET requests.

    Methods inherited from class org.apache.catalina.servlets.DefaultServlet

    checkIfHeaders, checkIfMatch, checkIfModifiedSince, checkIfNoneMatch, checkIfUnmodifiedSince, checkSendfile, copy, copy, copy, copy, copyRange, copyRange, copyRange, destroy, determineMethodsAllowed, doDelete, doHead, doOptions, doPost, doPut, executePartialPut, findXsltSource, generateETag, getPathPrefix, getReadme, getRelativePath, getRelativePath, init, parseContentRange, parseRange, render, render, renderHtml, renderHtml, renderSize, renderXml, renderXml, rewriteUrl, sendNotAllowed, serveResource, service

    Methods inherited from class javax.servlet.http.HttpServlet

    doTrace, getLastModified, service

    Methods inherited from class javax.servlet.GenericServlet

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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BambooDefaultServlet

      public BambooDefaultServlet()
  • Method Details

    • doGet

      public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Handles HTTP GET requests.

      This method serves files from allowed paths or files that exactly match the paths in the allowed files list. It verifies if the requested resource corresponds to a valid file and if it's located in one of the allowed paths. If the file is listed in the allowed files list, it's considered valid regardless of its path. If the real path doesn't correspond to a file, or if the requested path is not in the allowed list or the allowed files list, a 404 error is returned. In case of any IOException or ServletException, an internal server error (500) is returned.

      Overrides:
      doGet in class org.apache.catalina.servlets.DefaultServlet
      Parameters:
      request - the HTTP request
      response - the HTTP response