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

View File

@@ -49,7 +49,6 @@ import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.ScheduledFuture;
@@ -437,7 +436,7 @@ public final class Channel {
private static String[] getEvents() {
List<String> events = new ArrayList<>();
try (DirectoryStream<Path> stream = Files.newDirectoryStream(Paths.get("scripts/event"))) {
try (DirectoryStream<Path> stream = Files.newDirectoryStream(Path.of("scripts/event"))) {
for (Path path : stream) {
String fileName = path.getFileName().toString();
events.add(fileName.substring(0, fileName.length() - 3));