Skip to content

Commit

Permalink
MiniClusterState change to Path completely
Browse files Browse the repository at this point in the history
  • Loading branch information
mlbiscoc committed Dec 13, 2024
1 parent e7f9be1 commit 5035793
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -556,21 +556,21 @@ public static Path getFile(String name) {
MiniClusterState.class.getClassLoader().getResource(name.replace(File.separatorChar, '/'));
if (url != null) {
try {
return new File(url.toURI()).toPath();
return Path.of(url.toURI());
} catch (Exception e) {
throw new RuntimeException(
"Resource was found on classpath, but cannot be resolved to a "
+ "normal file (maybe it is part of a JAR file): "
+ name);
}
}
File file = new File(name);
if (file.exists()) {
return file.toPath();
Path file = Path.of(name);
if (Files.exists(file)) {
return file;
} else {
file = new File("../../../", name);
if (file.exists()) {
return file.toPath();
file = Path.of("../../../", name);
if (Files.exists(file)) {
return file;
}
}
throw new RuntimeException(
Expand Down

0 comments on commit 5035793

Please sign in to comment.