private void setLocationAndTrackBack(MavenVersion version) {
   try {
     Files files = getFiles(version);
     version.setLocation(files.getArtifactLocation());
     version.setTrackBackUrl(files.getTrackBackUrl());
   } catch (Exception ex) {
     LOGGER.error("Error getting location for " + version.getRevisionLabel(), ex);
     version.setErrorMessage(
         "Plugin could not determine location/trackback. Please see plugin log for details.");
   }
 }
示例#2
0
文件: CurlTask.java 项目: mmb/gocd
 private GoPluginApiResponse handleTaskView() {
   int responseCode = DefaultGoApiResponse.SUCCESS_RESPONSE_CODE;
   HashMap view = new HashMap();
   view.put("displayValue", "Curl");
   try {
     view.put(
         "template",
         IOUtils.toString(getClass().getResourceAsStream("/views/task.template.html"), "UTF-8"));
   } catch (Exception e) {
     responseCode = DefaultGoApiResponse.INTERNAL_ERROR;
     String errorMessage = "Failed to find template: " + e.getMessage();
     view.put("exception", errorMessage);
     logger.error(errorMessage, e);
   }
   return createResponse(responseCode, view);
 }