コード例 #1
0
 @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);
 }
コード例 #2
0
 @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() + "'");
   }
 }
コード例 #3
0
 @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);
   }
 }