jenkins.plugins.shiningpanda.actions.coverage
Class CoverageAction

java.lang.Object
  extended by jenkins.plugins.shiningpanda.actions.coverage.CoverageAction
All Implemented Interfaces:
hudson.model.Action, hudson.model.ModelObject
Direct Known Subclasses:
CoverageBuildAction, CoverageProjectAction

public abstract class CoverageAction
extends Object
implements hudson.model.Action


Nested Class Summary
 class CoverageAction.Entry
          Bean used to generate page.
 
Constructor Summary
CoverageAction()
           
 
Method Summary
 String getDisplayName()
           
 String getIconFileName()
           
protected  String getPath(org.kohsuke.stapler.StaplerRequest req)
          Get the request path.
protected  List<String> getReports(File base)
          Get the list of available reports.
 String getUrlName()
           
protected  boolean hasReports(File base)
          Check if a directory contains some reports.
protected  boolean isReport(File base)
          Check if the provided folder is a report folder.
protected  void serve(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String title, File base, String path)
          Server a request.
protected abstract  boolean show()
          Check if show the coverage action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoverageAction

public CoverageAction()
Method Detail

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject

getUrlName

public String getUrlName()
Specified by:
getUrlName in interface hudson.model.Action

getIconFileName

public String getIconFileName()
Specified by:
getIconFileName in interface hudson.model.Action

show

protected abstract boolean show()
Check if show the coverage action.

Returns:
True if the action must be visible, else false

getPath

protected String getPath(org.kohsuke.stapler.StaplerRequest req)
Get the request path.

Parameters:
req - The request
Returns:
The path

hasReports

protected boolean hasReports(File base)
Check if a directory contains some reports.

Parameters:
base - The base directory
Returns:
True if contains reports, else false

getReports

protected List<String> getReports(File base)
Get the list of available reports.

Parameters:
base - The base directory
Returns:
The list of relative paths to reports

serve

protected void serve(org.kohsuke.stapler.StaplerRequest req,
                     org.kohsuke.stapler.StaplerResponse rsp,
                     String title,
                     File base,
                     String path)
              throws IOException,
                     javax.servlet.ServletException
Server a request.

Parameters:
req - The request
rsp - The response
title - The title if an index page is generated
base - The base folder
path - The path to serve
Throws:
IOException
javax.servlet.ServletException

isReport

protected boolean isReport(File base)
Check if the provided folder is a report folder.

Parameters:
base - The folder to check
Returns:
True if this is a report, else false


Copyright © 2004-2012. All Rights Reserved.