Class AbstractRequestHandler

    • Constructor Detail

      • AbstractRequestHandler

        public AbstractRequestHandler()
    • Method Detail

      • getOwner

        @CheckForNull
        public Object getOwner​(org.kohsuke.stapler.StaplerRequest req)
        Gets the owner of this action.
        Parameters:
        req - the StaplerRequest used for access this action
        Returns:
        the AbstractProject or AbstractBuild or null if no proper owner exists
      • getBuild

        @CheckForNull
        public abstract Run<?,​?> getBuild​(org.kohsuke.stapler.StaplerRequest req)
        Gets the build that have report artifacts this action handles.

        If called in a project context, returns the last build that contains report artifacts.

        Parameters:
        req - the StaplerRequest used for access this action
        Returns:
        the build with report artifacts to handle or null if no proper build exists
      • getBuildAction

        @CheckForNull
        protected AbstractReportAction getBuildAction​(org.kohsuke.stapler.StaplerRequest req)
        Resolves the build action containing the report artifacts by StaplerRequest.findAncestorObject(Class).
        Parameters:
        req - the StaplerRequest used for access this report
        Returns:
        the build action with report artifacts to handle or null if no proper build action exists
      • getAnchestorBuild

        @CheckForNull
        protected Run<?,​?> getAnchestorBuild​(org.kohsuke.stapler.StaplerRequest req)
        Gets the build of this action.
        Parameters:
        req - the StaplerRequest used for access this action
        Returns:
        the build containing this action or null if no proper project exists
      • getAnchestorProject

        @CheckForNull
        protected Job<?,​?> getAnchestorProject​(org.kohsuke.stapler.StaplerRequest req)
        Gets the project of this action.
        Parameters:
        req - the StaplerRequest used for access this action
        Returns:
        the project containing this action or null if no proper project exists
      • doZipDownload

        public void doZipDownload​(org.kohsuke.stapler.StaplerRequest req,
                                  org.kohsuke.stapler.StaplerResponse rsp)
                           throws IOException
        Serves the compressed contents of the archive directory that is requested via HTTP.
        Parameters:
        req - the StaplerRequest used for access this report
        rsp - the StaplerResponse used for serving the file
        Throws:
        IOException - signals that an I/O exception has occurred