This is an automated email from the ASF dual-hosted git repository.

benjobs pushed a commit to branch dev-2.1.3
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev-2.1.3 by this push:
     new f05a93e06 [Improve] minor improvement
f05a93e06 is described below

commit f05a93e067f3cee7776950516b860c8cecaf8662
Author: benjobs <[email protected]>
AuthorDate: Fri Dec 15 13:02:07 2023 +0800

    [Improve] minor improvement
---
 .mvn/wrapper/MavenWrapperHelper.java | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/.mvn/wrapper/MavenWrapperHelper.java 
b/.mvn/wrapper/MavenWrapperHelper.java
index 4f0b5cdbd..b4a28e961 100644
--- a/.mvn/wrapper/MavenWrapperHelper.java
+++ b/.mvn/wrapper/MavenWrapperHelper.java
@@ -64,6 +64,7 @@ public final class MavenWrapperHelper {
   public static void main(String[] args) throws Exception {
     String action = args[0].toLowerCase();
     String[] actionArgs = Arrays.copyOfRange(args, 1, args.length);
+    Properties properties;
 
     switch (action) {
       case "download":
@@ -90,10 +91,7 @@ public final class MavenWrapperHelper {
 
       case "verify_wrapper":
         String wrapperJar = actionArgs[0];
-        String propertiesPath = actionArgs[1];
-        Properties properties = new Properties();
-        properties.load(Files.newInputStream(new 
File(propertiesPath).toPath()));
-
+        properties = getProperties(actionArgs[1]);
         String wrapperMd5 = properties.getProperty("wrapperMd5");
         if (wrapperMd5 != null) {
           String fileMd5 = getFileMd5(wrapperJar);
@@ -109,9 +107,7 @@ public final class MavenWrapperHelper {
         break;
 
       case "verify_dist":
-        propertiesPath = actionArgs[0];
-        properties = new Properties();
-        properties.load(Files.newInputStream(new 
File(propertiesPath).toPath()));
+        properties = getProperties(actionArgs[0]);
         LocalDistribution distribution = getLocalDistribution(properties);
 
         File zipFile = distribution.getZipFile();
@@ -165,6 +161,12 @@ public final class MavenWrapperHelper {
     }
   }
 
+  private static Properties getProperties(String path) throws IOException {
+    Properties properties = new Properties();
+    properties.load(Files.newInputStream(new File(path).toPath()));
+    return properties;
+  }
+
   private static String getMavenCheckCMD(String[] actionArgs) {
     String javaCMD = actionArgs[1];
     String mvnWrapperHome = actionArgs[2];
@@ -328,4 +330,4 @@ public final class MavenWrapperHelper {
       return distZip;
     }
   }
-}
+}
\ No newline at end of file

Reply via email to