Skip to content

Commit

Permalink
Use Jenkins annotation to control HTTP protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
alecharp committed May 18, 2022
1 parent 554b639 commit c62420e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import java.util.Collections;
import java.util.Map;

import javax.ws.rs.POST;

import org.apache.commons.lang.StringUtils;
import org.jenkinsci.plugins.maven_artifact_choicelistprovider.AbstractMavenArtifactChoiceListProvider;
import org.jenkinsci.plugins.maven_artifact_choicelistprovider.AbstractMavenArtifactDescriptorImpl;
Expand All @@ -26,6 +24,7 @@
import hudson.security.ACL;
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
import org.kohsuke.stapler.interceptor.RequirePOST;

public class ArtifactoryChoiceListProvider extends AbstractMavenArtifactChoiceListProvider {

Expand Down Expand Up @@ -67,7 +66,7 @@ public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item pItem) {
return retVal;
}

@POST
@RequirePOST
public FormValidation doTest(@AncestorInPath Item pItem, @QueryParameter String url, @QueryParameter String credentialsId, @QueryParameter String groupId,
@QueryParameter String artifactId, @QueryParameter String packaging, @QueryParameter String classifier,
@QueryParameter boolean inverseFilter, @QueryParameter String filterExpression, @QueryParameter boolean reverseOrder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import java.util.Collections;
import java.util.Map;

import javax.ws.rs.POST;

import org.apache.commons.lang.StringUtils;
import org.jenkinsci.plugins.maven_artifact_choicelistprovider.AbstractMavenArtifactChoiceListProvider;
import org.jenkinsci.plugins.maven_artifact_choicelistprovider.IVersionReader;
Expand All @@ -26,6 +24,7 @@
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
import jp.ikedam.jenkins.plugins.extensible_choice_parameter.ChoiceListProvider;
import org.kohsuke.stapler.interceptor.RequirePOST;


/**
Expand Down Expand Up @@ -107,7 +106,7 @@ public FormValidation doCheckArtifactId(@QueryParameter String artifactId) {
return FormValidation.ok();
}

@POST
@RequirePOST
public FormValidation doTest(@AncestorInPath Item pItem, @QueryParameter String url, @QueryParameter String credentialsId, @QueryParameter String repositoryId,
@QueryParameter String groupId, @QueryParameter String artifactId,
@QueryParameter boolean inverseFilter, @QueryParameter String filterExpression, @QueryParameter boolean reverseOrder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import java.util.Map;
import java.util.logging.Logger;

import javax.ws.rs.POST;

import org.apache.commons.lang.StringUtils;
import org.jenkinsci.plugins.maven_artifact_choicelistprovider.AbstractMavenArtifactChoiceListProvider;
import org.jenkinsci.plugins.maven_artifact_choicelistprovider.AbstractMavenArtifactDescriptorImpl;
Expand All @@ -29,6 +27,7 @@
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.interceptor.RequirePOST;

public class NexusChoiceListProvider extends AbstractMavenArtifactChoiceListProvider {

Expand Down Expand Up @@ -80,7 +79,7 @@ public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item pItem) {
return retVal;
}

@POST
@RequirePOST
public FormValidation doTest(@AncestorInPath Item pItem, @QueryParameter String url, @QueryParameter String credentialsId, @QueryParameter String repositoryId,
@QueryParameter String groupId, @QueryParameter String artifactId, @QueryParameter String packaging, @QueryParameter String classifier,
@QueryParameter boolean inverseFilter, @QueryParameter String filterExpression, @QueryParameter boolean reverseOrder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import java.util.Collections;
import java.util.Map;

import javax.ws.rs.POST;

import org.apache.commons.lang.StringUtils;
import org.jenkinsci.plugins.maven_artifact_choicelistprovider.AbstractMavenArtifactChoiceListProvider;
import org.jenkinsci.plugins.maven_artifact_choicelistprovider.AbstractMavenArtifactDescriptorImpl;
Expand All @@ -28,6 +26,7 @@
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.interceptor.RequirePOST;

public class Nexus3ChoiceListProvider extends AbstractMavenArtifactChoiceListProvider {

Expand Down Expand Up @@ -74,7 +73,7 @@ public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item pItem) {
return retVal;
}

@POST
@RequirePOST
public FormValidation doTest(@AncestorInPath Item pItem, @QueryParameter String url, @QueryParameter String credentialsId, @QueryParameter String repositoryId,
@QueryParameter String groupId, @QueryParameter String artifactId, @QueryParameter String packaging, @QueryParameter String classifier,
@QueryParameter boolean inverseFilter, @QueryParameter String filterExpression, @QueryParameter boolean reverseOrder) {
Expand Down

0 comments on commit c62420e

Please sign in to comment.