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

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


The following commit(s) were added to refs/heads/dev by this push:
     new cee932b37 [Fix] Upload Flink App jar got "flink app jar must exist" 
error on windows (#4052) (#4053)
cee932b37 is described below

commit cee932b37cd0df37e1c877e36293a344f24236c6
Author: Daniel Duan <[email protected]>
AuthorDate: Thu Oct 3 11:56:31 2024 +0800

    [Fix] Upload Flink App jar got "flink app jar must exist" error on windows 
(#4052) (#4053)
    
    * fix Upload Flink App jar got "flink app jar must exist" error on windows
---
 .../java/org/apache/streampark/console/core/entity/Resource.java    | 4 ++--
 .../streampark/console/core/service/impl/ResourceServiceImpl.java   | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Resource.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Resource.java
index 95b59e1f4..887c77454 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Resource.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Resource.java
@@ -83,7 +83,7 @@ public class Resource extends BaseEntity {
         if (StringUtils.isBlank(resourcePath)) {
             throw new IllegalArgumentException("resource path cannot be 
null.");
         }
-        String[] namePath = resourcePath.split(":");
+        String[] namePath = resourcePath.split(":", 2);
         if (namePath.length != 2) {
             throw new IllegalArgumentException("resource path invalid, format: 
$name:$path");
         }
@@ -101,6 +101,6 @@ public class Resource extends BaseEntity {
         if (StringUtils.isBlank(this.resourcePath)) {
             return null;
         }
-        return resourcePath.split(":")[1];
+        return resourcePath.split(":", 2)[1];
     }
 }
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ResourceServiceImpl.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ResourceServiceImpl.java
index 95e6ed6a5..9ca1ea775 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ResourceServiceImpl.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ResourceServiceImpl.java
@@ -153,7 +153,7 @@ public class ResourceServiceImpl extends 
ServiceImpl<ResourceMapper, Resource>
             String resourcePath = jars.get(0);
             resource.setResourcePath(resourcePath);
             // copy jar to team upload directory
-            String upFile = resourcePath.split(":")[1];
+            String upFile = resourcePath.split(":", 2)[1];
             transferTeamResource(resource.getTeamId(), upFile);
         }
 
@@ -207,7 +207,7 @@ public class ResourceServiceImpl extends 
ServiceImpl<ResourceMapper, Resource>
 
             Dependency dependency = 
Dependency.toDependency(resource.getResource());
             if (!dependency.getJar().isEmpty()) {
-                String jarFile = dependency.getJar().get(0).split(":")[1];
+                String jarFile = dependency.getJar().get(0).split(":", 2)[1];
                 transferTeamResource(findResource.getTeamId(), jarFile);
             }
         }
@@ -446,7 +446,7 @@ public class ResourceServiceImpl extends 
ServiceImpl<ResourceMapper, Resource>
             return null;
         }
         if (!dependency.getJar().isEmpty()) {
-            String jar = dependency.getJar().get(0).split(":")[1];
+            String jar = dependency.getJar().get(0).split(":", 2)[1];
             return new File(jar);
         } else {
             Artifact artifact = dependency.toArtifact().get(0);

Reply via email to