本文整理匯總了Java中org.kohsuke.stapler.StaplerRequest.checkIfModified方法的典型用法代碼示例。如果您正苦於以下問題:Java StaplerRequest.checkIfModified方法的具體用法?Java StaplerRequest.checkIfModified怎麽用?Java StaplerRequest.checkIfModified使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.kohsuke.stapler.StaplerRequest
的用法示例。
在下文中一共展示了StaplerRequest.checkIfModified方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doGraph
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
* Create the graph image for the number of pass/warn/fail results in a test run, for the previous three Jenkins runs.
*
* @param request
* @param response
* @throws IOException
*/
@SuppressWarnings("unused")
public void doGraph(StaplerRequest request, StaplerResponse response) throws IOException {
// Abort if having Java AWT issues.
if (ChartUtil.awtProblemCause != null) {
response.sendRedirect2(String.format("%s/images/headless.png", request.getContextPath()));
return;
}
// Check the "If-Modified-Since" header and abort if we don't need re-create the graph.
if (isCompleted()) {
Calendar timestamp = getOwner().getTimestamp();
if (request.checkIfModified(timestamp, response)) {
return;
}
}
// Create new graph for this AWS Device Farm result.
Graph graph = AWSDeviceFarmGraph.createResultTrendGraph(build, isCompleted(), getPreviousResults(DefaultTrendGraphSize));
graph.doPng(request, response);
}
示例2: doDurationGraph
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
* Create the graph image for the number of device minutes used in a test run, for the previous three Jenkins runs.
*
* @param request
* @param response
* @throws IOException
*/
@SuppressWarnings("unused")
public void doDurationGraph(StaplerRequest request, StaplerResponse response) throws IOException {
// Abort if having Java AWT issues.
if (ChartUtil.awtProblemCause != null) {
response.sendRedirect2(String.format("%s/images/headless.png", request.getContextPath()));
return;
}
// Check the "If-Modified-Since" header and abort if we don't need re-create the graph.
if (isCompleted()) {
Calendar timestamp = getOwner().getTimestamp();
if (request.checkIfModified(timestamp, response)) {
return;
}
}
// Create new duration graph for this AWS Device Farm result.
Graph graph = AWSDeviceFarmGraph.createDurationTrendGraph(build, isCompleted(), getPreviousResults(DefaultTrendGraphSize));
graph.doPng(request, response);
}
示例3: doGraph
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
* Generates a PNG image for the test result trend.
*/
public void doGraph(StaplerRequest req, StaplerResponse rsp) throws IOException {
if (ChartUtil.awtProblemCause != null) {
// not available. send out error message
rsp.sendRedirect2(req.getContextPath() + "/images/headless.png");
return;
}
CxScanResult cxScanResult = getLastSynchronousBuildAction();
if (cxScanResult != null && req.checkIfModified(cxScanResult.owner.getTimestamp(), rsp)) {
return;
}
ChartUtil.generateGraph(req, rsp, createChart(req, buildDataSet(req)), calcDefaultSize());
}
示例4: doGraphMap
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
* Generates a clickable map HTML for {@link #doGraph(StaplerRequest, StaplerResponse)}.
*/
public void doGraphMap(StaplerRequest req, StaplerResponse rsp) throws IOException {
CxScanResult cxScanResult = getLastSynchronousBuildAction();
if (cxScanResult != null && req.checkIfModified(cxScanResult.owner.getTimestamp(), rsp)) {
return;
}
ChartUtil.generateClickableMap(req, rsp, createChart(req, buildDataSet(req)), calcDefaultSize());
}