Skip to content

Commit

Permalink
[Fix] Upload Flink App jar got "flink app jar must exist" error on wi…
Browse files Browse the repository at this point in the history
…ndows (#4052) (#4053)

* fix Upload Flink App jar got "flink app jar must exist" error on windows
  • Loading branch information
FrommyMind authored Oct 3, 2024
1 parent d435746 commit cee932b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void setResourcePath(String resourcePath) {
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");
}
Expand All @@ -101,6 +101,6 @@ public String getFilePath() {
if (StringUtils.isBlank(this.resourcePath)) {
return null;
}
return resourcePath.split(":")[1];
return resourcePath.split(":", 2)[1];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public void addResource(Resource resource) throws Exception {
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);
}

Expand Down Expand Up @@ -207,7 +207,7 @@ public void updateResource(Resource 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);
}
}
Expand Down Expand Up @@ -446,7 +446,7 @@ private File getResourceJar(Resource resource) throws Exception {
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);
Expand Down

0 comments on commit cee932b

Please sign in to comment.