Source:
<code>public static void init() { final SpongePlayerDataHandler handlerInstance = Holder.INSTANCE; if (!Sponge.isServerAvailable() || handlerInstance.hasInitialized) { return; } final Path filePath = DimensionManager.getCurrentSavesDirectory().get().resolve("data").resolve (SPONGE_DATA); try { handlerInstance.playerDir = filePath; Files.createDirectories(handlerInstance.playerDir); final List<Path> playerFiles = new ArrayList<>(); try (DirectoryStream<Path> stream = Files.newDirectoryStream(filePath, "*.{dat}")) { for (Path entry : stream) { playerFiles.add(entry); } } catch (DirectoryIteratorException e) { SpongeImpl.getLogger().error("Something happened when trying to gather all player files", e); } for (Path playerFile : playerFiles) { <START> File actualFile = playerFile.toFile(); <END> if (actualFile.exists() && actualFile.isFile()) { FileInputStream stream = new FileInputStream(actualFile); NBTTagCompound compound = CompressedStreamTools.readCompressed(stream); stream.close(); DataContainer container = NbtTranslator.getInstance().translateFrom(compound); SpongePlayerData data = container.getSerializable(DataQuery.of(), SpongePlayerData.class).get(); handlerInstance.playerDataMap.put(data.uuid, data); } } playerFiles.clear(); } catch (FileAlreadyExistsException e) { SpongeImpl.getLogger().error("Someone went and created a file for the desired path: {}", filePath); } catch (Exception e) { e.printStackTrace(); } handlerInstance.hasInitialized = true; }</code><technical_language>Is a reason java.io.File here? methods for Path Files.isReadable Files.isRegularFile ot that, Files.newInputStream</technical_language>

Target:
public static void init() { final SpongePlayerDataHandler handlerInstance = Holder.INSTANCE; if (!Sponge.isServerAvailable() || handlerInstance.hasInitialized) { return; } handlerInstance.playerDataMap = new ConcurrentHashMap<>(); final Path filePath = DimensionManager.getCurrentSavesDirectory().get().resolve("data").resolve (SPONGE_DATA); try { handlerInstance.playerDir = filePath; Files.createDirectories(handlerInstance.playerDir); final List<Path> playerFiles = new ArrayList<>(); try (DirectoryStream<Path> stream = Files.newDirectoryStream(filePath, "*.{dat}")) { for (Path entry : stream) { playerFiles.add(entry); } } catch (DirectoryIteratorException e) { SpongeImpl.getLogger().error("Something happened when trying to gather all player files", e); } for (Path playerFile : playerFiles) { if (Files.isReadable(playerFile)) { NBTTagCompound compound; try (final InputStream stream = Files.newInputStream(playerFile)) { compound = CompressedStreamTools.readCompressed(stream); } if (compound == null) { throw new RuntimeException("Failed to decompress player data within [" + playerFile + "]!"); } DataContainer container = NbtTranslator.getInstance().translateFrom(compound); SpongePlayerData data = container.getSerializable(DataQuery.of(), SpongePlayerData.class).get(); handlerInstance.playerDataMap.put(data.uuid, data); } } playerFiles.clear(); } catch (FileAlreadyExistsException e) { SpongeImpl.getLogger().error("Someone went and created a file for the desired path: {}", filePath); } catch (Exception e) { e.printStackTrace(); } handlerInstance.hasInitialized = true; }