docs: public void doDynamic(StaplerRequest request, StaplerResponse response) throws ServletException, IOException {
          if (("/" + originalFileName).equals(request.getRestOfPath())) {
              AbstractBuild build = (AbstractBuild)request.findAncestor(AbstractBuild.class).getObject();
              File fileParameter = getLocationUnderBuild(build);
  
              if (!ALLOW_FOLDER_TRAVERSAL_OUTSIDE_WORKSPACE) {
                  File fileParameterFolder = getFileParameterFolderUnderBuild(build);
  
                  //TODO can be replaced by Util#isDescendant in 2.80+
                  Path child = fileParameter.getAbsoluteFile().toPath().normalize();
                  Path parent = fileParameterFolder.getAbsoluteFile().toPath().normalize();
                  if (!child.startsWith(parent)) {
                      throw new IllegalStateException("The fileParameter tried to escape the expected folder: " + location);
                  }
              }
  
              if (fileParameter.isFile()) {
                  try (InputStream data = Files.newInputStream(fileParameter.toPath())) {
                      long lastModified = fileParameter.lastModified();
                      long contentLength = fileParameter.length();
                      if (request.hasParameter("view")) {
                          response.serveFile(request, data, lastModified, contentLength, "plain.txt");
                      } else {
                          response.serveFile(request, data, lastModified, contentLength, originalFileName);
                      }
                  } catch (InvalidPathException e) {
                      throw new IOException(e);
                  }
              }
          }
      }