From e9fc426dfee5e369ac5069a3ab6c23d95c5de6b3 Mon Sep 17 00:00:00 2001 From: mantou Date: Thu, 11 Mar 2021 10:52:12 +0800 Subject: [PATCH] format --- .../inurl/jenkins/plugin/OSSPublisher.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/inurl/jenkins/plugin/OSSPublisher.java b/src/main/java/org/inurl/jenkins/plugin/OSSPublisher.java index 71b5740..676e91f 100644 --- a/src/main/java/org/inurl/jenkins/plugin/OSSPublisher.java +++ b/src/main/java/org/inurl/jenkins/plugin/OSSPublisher.java @@ -71,7 +71,7 @@ public class OSSPublisher extends Publisher implements SimpleBuildStep { @DataBoundConstructor public OSSPublisher(String endpoint, String accessKeyId, String accessKeySecret, String bucketName, - String localPath, String remotePath, String maxRetries) { + String localPath, String remotePath, String maxRetries) { this.endpoint = endpoint; this.accessKeyId = accessKeyId; this.accessKeySecret = Secret.fromString(accessKeySecret); @@ -88,18 +88,18 @@ public class OSSPublisher extends Publisher implements SimpleBuildStep { @Override public void perform(@Nonnull Run run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, - @Nonnull TaskListener listener) throws InterruptedException, IOException { + @Nonnull TaskListener listener) throws InterruptedException, IOException { PrintStream logger = listener.getLogger(); - EnvVars envVars = run.getEnvironment(listener); + EnvVars envVars = run.getEnvironment(listener); OSSClient client = new OSSClient(endpoint, accessKeyId, accessKeySecret.getPlainText()); String local = localPath.substring(1); String remote = remotePath.substring(1); - - String expandLocal = envVars.expand(local); - String expandRemote = envVars.expand(remote); - logger.println("expandLocalPath =>" + expandLocal); - logger.println("expandRemotePath =>" + expandRemote); - FilePath p = new FilePath(workspace, expandLocal); + + String expandLocal = envVars.expand(local); + String expandRemote = envVars.expand(remote); + logger.println("expandLocalPath =>" + expandLocal); + logger.println("expandRemotePath =>" + expandRemote); + FilePath p = new FilePath(workspace, expandLocal); if (p.isDirectory()) { logger.println("upload dir => " + p); upload(client, logger, expandRemote, p, true); @@ -113,7 +113,7 @@ public class OSSPublisher extends Publisher implements SimpleBuildStep { } private void upload(OSSClient client, PrintStream logger, String base, FilePath path, boolean root) - throws InterruptedException, IOException { + throws InterruptedException, IOException { if (path.isDirectory()) { for (FilePath f : path.list()) { upload(client, logger, base + (root ? "" : ("/" + path.getName())), f, false); @@ -124,7 +124,7 @@ public class OSSPublisher extends Publisher implements SimpleBuildStep { } private void uploadFile(OSSClient client, PrintStream logger, String key, FilePath path) - throws InterruptedException, IOException { + throws InterruptedException, IOException { if (!path.exists()) { logger.println("file [" + path.getRemote() + "] not exists, skipped"); return; @@ -146,7 +146,7 @@ public class OSSPublisher extends Publisher implements SimpleBuildStep { } private void uploadFile0(OSSClient client, PrintStream logger, String key, FilePath path) - throws InterruptedException, IOException { + throws InterruptedException, IOException { String realKey = key; if (realKey.startsWith("/")) { realKey = realKey.substring(1); -- GitLab