ruanwenjun commented on code in PR #1697:
URL:
https://github.com/apache/incubator-seatunnel/pull/1697#discussion_r856246522
##########
seatunnel-config/seatunnel-config-shade/src/test/java/org/apache/seatunnel/config/utils/FileUtils.java:
##########
@@ -27,16 +27,13 @@ private FileUtils() {
// get file from classpath, resources folder
public static File getFileFromResources(String fileName) {
-
- ClassLoader classLoader = FileUtils.class.getClassLoader();
-
+ ClassLoader classLoader =
Thread.currentThread().getContextClassLoader();
Review Comment:
I debug at my laptop, the classloader is the same with
`FileUtils.class.getClassLoader`.
And I find there is a better way to solve these path issue in window.
https://stackoverflow.com/questions/6164448/convert-url-to-normal-windows-filename-java
```
URL resource = classLoader.getResource(fileName);
Paths.get(resource.toURI()).toFile();
```
##########
seatunnel-config/seatunnel-config-shade/src/test/java/org/apache/seatunnel/config/utils/FileUtils.java:
##########
@@ -27,16 +27,13 @@ private FileUtils() {
// get file from classpath, resources folder
public static File getFileFromResources(String fileName) {
-
- ClassLoader classLoader = FileUtils.class.getClassLoader();
-
+ ClassLoader classLoader =
Thread.currentThread().getContextClassLoader();
Review Comment:
I debug at my laptop, the classloader is the same with
`FileUtils.class.getClassLoader`.
And I find there is a better way to solve these path issue in window.
https://stackoverflow.com/questions/6164448/convert-url-to-normal-windows-filename-java
```
URL resource = classLoader.getResource(fileName);
return Paths.get(resource.toURI()).toFile();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]