Class AbstractRequestHandler
- java.lang.Object
-
- de.tracetronic.jenkins.plugins.ecutest.report.AbstractRequestHandler
-
- Direct Known Subclasses:
AbstractReportAction
,AbstractTestReport
public abstract class AbstractRequestHandler extends Object
Common base class providing shared methods to handleStaplerRequest
s.
-
-
Constructor Summary
Constructors Constructor Description AbstractRequestHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
doZipDownload(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Serves the compressed contents of the archive directory that is requested via HTTP.protected Run<?,?>
getAnchestorBuild(org.kohsuke.stapler.StaplerRequest req)
Gets the build of this action.protected Job<?,?>
getAnchestorProject(org.kohsuke.stapler.StaplerRequest req)
Gets the project of this action.protected abstract VirtualFile
getArchiveTargetDir(File rootDir)
Gets the archive target directory for use indoZipDownload(org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse)
.abstract Run<?,?>
getBuild(org.kohsuke.stapler.StaplerRequest req)
Gets the build that have report artifacts this action handles.protected AbstractReportAction
getBuildAction(org.kohsuke.stapler.StaplerRequest req)
Resolves the build action containing the report artifacts byStaplerRequest.findAncestorObject(Class)
.Object
getOwner(org.kohsuke.stapler.StaplerRequest req)
Gets the owner of this action.
-
-
-
Method Detail
-
getOwner
@CheckForNull public Object getOwner(org.kohsuke.stapler.StaplerRequest req)
Gets the owner of this action.- Parameters:
req
- theStaplerRequest
used for access this action- Returns:
- the
AbstractProject
orAbstractBuild
ornull
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
- theStaplerRequest
used for access this action- Returns:
- the build with report artifacts to handle or
null
if no proper build exists
-
getArchiveTargetDir
protected abstract VirtualFile getArchiveTargetDir(File rootDir)
Gets the archive target directory for use indoZipDownload(org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse)
.- Parameters:
rootDir
- the root directory- Returns:
- the archive target directory
-
getBuildAction
@CheckForNull protected AbstractReportAction getBuildAction(org.kohsuke.stapler.StaplerRequest req)
Resolves the build action containing the report artifacts byStaplerRequest.findAncestorObject(Class)
.- Parameters:
req
- theStaplerRequest
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
- theStaplerRequest
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
- theStaplerRequest
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
- theStaplerRequest
used for access this reportrsp
- theStaplerResponse
used for serving the file- Throws:
IOException
- signals that an I/O exception has occurred
-
-