예제 #1
0
 @Override
 public void execute(ArtifactoryRestRequest request, RestResponse response) {
   String name = request.getPathParamByKey("name");
   String buildNumber = request.getPathParamByKey("number");
   try {
     String buildStarted =
         DateUtils.formatBuildDate(Long.parseLong(request.getPathParamByKey("date")));
     // fetch build issues
     fetchBuildIssues(response, name, buildNumber, buildStarted);
   } catch (ParseException e) {
     log.error(e.toString());
   }
 }
 @Override
 public void execute(ArtifactoryRestRequest request, RestResponse response) {
   AolUtils.assertNotAol("CreateProxy");
   ProxyDescriptor proxyDescriptor = (ProxyDescriptor) request.getImodel();
   // add new proxy to configuration
   addNewProxy(proxyDescriptor);
   // update response feedback
   updateResponse(response, proxyDescriptor);
 }
 @Override
 public void execute(ArtifactoryRestRequest request, RestResponse response) {
   GradleSettingModel gradleSettingModel = (GradleSettingModel) request.getImodel();
   boolean downloadScript = Boolean.valueOf(request.getQueryParamByKey("downloadScript"));
   boolean downloadGradleProps = Boolean.valueOf(request.getQueryParamByKey("gradleProps"));
   String servletContextUrl = HttpUtils.getServletContextUrl(request.getServletRequest());
   // generate maven settings
   String gradleSnippet = generateSettings(servletContextUrl, gradleSettingModel, response);
   if (downloadGradleProps) {
     downLoadGradleProps(response, servletContextUrl);
     return;
   }
   if (downloadScript) {
     downloadGradleBuildFile(response, gradleSnippet);
     return;
   } else {
     // update maven setting model
     GradleSettingModel mavenSnippetModel = new GradleSettingModel(gradleSnippet);
     mavenSnippetModel.clearProps();
     response.iModel(mavenSnippetModel);
   }
 }
 @Override
 public void execute(ArtifactoryRestRequest request, RestResponse response) {
   PropertiesArtifactInfo propertiesTab = (PropertiesArtifactInfo) request.getImodel();
   try {
     RepoPath repoPath = RequestUtils.getPathFromRequest(request);
     propsService.editProperty(
         repoPath,
         propertiesTab.getParent(),
         propertiesTab.getProperty(),
         propertiesTab.getSelectedValues());
     response.info(
         "Successfully updated property '" + propertiesTab.getProperty().getName() + "'");
   } catch (Exception e) {
     log.error("Failed to create property '" + propertiesTab.getProperty().getName() + "'");
     response.info("Failed to update property '" + propertiesTab.getProperty().getName() + "'");
   }
 }