Prefer Path.of() over Paths.get()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user