Пример #1
0
 /**
  * Handle an explicit request for a root directory file (path must start with "/root/".
  *
  * <p>Note: As these requests will show the configuration files for the server, these requests
  * should be covered by security constraints.
  *
  * <p>
  *
  * <ol>
  *   <li>Make sure the path does not contain ".." directories.
  *   <li>Check for the requested file in the root directory. </ol
  *
  * @param path the requested path (must start with "/root/")
  * @param servlet the servlet handling the request
  * @param req the HttpServletRequest
  * @param res the HttpServletResponse
  * @throws IOException if can't complete request due to IO problems.
  */
 public static void handleRequestForRootFile(
     String path, HttpServlet servlet, HttpServletRequest req, HttpServletResponse res)
     throws IOException {
   handleRequestForContentOrRootFile("/root/", path, servlet, req, res);
 }