Skip to content

Commit d597d77

Browse files
Paddy0523tiezhu
authored andcommitted
[hotfix-53211][Launcher]1.add the URLEncoder for job JSON in the OptionParser 2.localTest import URLEncoder
1 parent 243a6d2 commit d597d77

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

flinkx-core/src/main/java/com/dtstack/flinkx/options/OptionParser.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.io.File;
2727
import java.io.FileInputStream;
2828
import java.lang.reflect.Field;
29+
import java.net.URLEncoder;
2930
import java.nio.charset.StandardCharsets;
3031
import java.util.ArrayList;
3132
import java.util.List;
@@ -89,7 +90,10 @@ public List<String> getProgramExeArgList() throws Exception {
8990
try (FileInputStream in = new FileInputStream(file)) {
9091
byte[] fileContent = new byte[(int) file.length()];
9192
in.read(fileContent);
92-
value = new String(fileContent, StandardCharsets.UTF_8);
93+
value =
94+
URLEncoder.encode(
95+
new String(fileContent, StandardCharsets.UTF_8),
96+
StandardCharsets.UTF_8.name());
9397
}
9498
}
9599
args.add("-" + key);

flinkx-local-test/src/main/java/com/dtstack/flinkx/local/test/LocalTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.lang.reflect.Method;
3030
import java.net.URL;
3131
import java.net.URLClassLoader;
32+
import java.net.URLEncoder;
3233
import java.nio.charset.StandardCharsets;
3334
import java.nio.file.Files;
3435
import java.nio.file.Paths;

0 commit comments

Comments
 (0)