Skip to content

Commit

Permalink
Fix static check
Browse files Browse the repository at this point in the history
  • Loading branch information
EyalDelarea committed Nov 17, 2024
1 parent f38a8ae commit 49355be
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/main/java/io/jenkins/plugins/jfrog/JfStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,6 @@ private void addConfigArguments(ArgumentListBuilder builder, JFrogPlatformInstan
}
}

private void addConfigArguments(ArgumentListBuilder builder, JFrogPlatformInstance jfrogPlatformInstance, String jfrogBinaryPath, Job<?, ?> job, Launcher.ProcStarter launcher) throws IOException {
builder.add(jfrogBinaryPath).add("c").add("add").add(jfrogPlatformInstance.getId());
addCredentialsArguments(builder, jfrogPlatformInstance, job, launcher);
addUrlArguments(builder, jfrogPlatformInstance);
builder.add("--interactive=false").add("--overwrite=true");
}

static void addCredentialsArguments(ArgumentListBuilder builder, JFrogPlatformInstance jfrogPlatformInstance, Job<?, ?> job, Launcher.ProcStarter launcher) throws IOException {
String credentialsId = jfrogPlatformInstance.getCredentialsConfig().getCredentialsId();
StringCredentials accessTokenCredentials = PluginsUtils.accessTokenCredentialsLookup(credentialsId, job);
Expand All @@ -313,7 +306,7 @@ static void addCredentialsArguments(ArgumentListBuilder builder, JFrogPlatformIn
// Stdin support requires a minimum CLI version and excludes plugin launchers.
// Plugin launchers may lose stdin input, causing command failure;
// hence, stdin is unsupported without plugin-specific handling.
private static void addPasswordArgument(ArgumentListBuilder builder, Credentials credentials, Launcher.ProcStarter launcher) throws IOException {
static void addPasswordArgument(ArgumentListBuilder builder, Credentials credentials, Launcher.ProcStarter launcher) throws IOException {
if (passwordStdinSupported) {
// Use stdin
builder.add("--password-stdin");
Expand All @@ -326,7 +319,7 @@ private static void addPasswordArgument(ArgumentListBuilder builder, Credentials
}
}

private static void addUrlArguments(ArgumentListBuilder builder, JFrogPlatformInstance jfrogPlatformInstance) {
static void addUrlArguments(ArgumentListBuilder builder, JFrogPlatformInstance jfrogPlatformInstance) {
builder.add("--url=" + jfrogPlatformInstance.getUrl());
builder.add("--artifactory-url=" + jfrogPlatformInstance.inferArtifactoryUrl());
builder.add("--distribution-url=" + jfrogPlatformInstance.inferDistributionUrl());
Expand Down

0 comments on commit 49355be

Please sign in to comment.