Prefer Path.of() over Paths.get()

This commit is contained in:
P0nk
2022-08-11 19:01:40 +02:00
parent 297d5b25f0
commit d691dc1e18
13 changed files with 26 additions and 32 deletions
+2 -3
View File
@@ -2,7 +2,6 @@ package provider.wz;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public enum WZFiles {
QUEST("Quest"),
@@ -28,7 +27,7 @@ public enum WZFiles {
}
public Path getFile() {
return Paths.get(DIRECTORY).resolve(fileName);
return Path.of(DIRECTORY, fileName);
}
public String getFilePath() {
@@ -38,7 +37,7 @@ public enum WZFiles {
private static String getWzDirectory() {
// Either provide a custom directory path through the "wz-path" property when launching the .jar, or don't provide one to use the default "wz" directory
String propertyPath = System.getProperty("wz-path");
if (propertyPath != null && Files.isDirectory(Paths.get(propertyPath))) {
if (propertyPath != null && Files.isDirectory(Path.of(propertyPath))) {
return propertyPath;
}