\r
String sourceFileName = source.getFileName().toString();\r
Path archive = Paths.get(archiveRoot.toString(), sourceFileName.replace(".stl", "_" + lang + ".stl"));\r
- boolean isOverride = archive.toFile().exists();\r
+ boolean isOverride = Files.exists(archive);\r
try {\r
ensureFolder(archiveRoot);\r
Files.copy(source, archive, StandardCopyOption.REPLACE_EXISTING);\r
\r
private void syncSubtitle(Path archive, Path syncTarget) {\r
Path sync = Paths.get(syncTarget.toString(), archive.getFileName().toString());\r
- logger.info(getMarker(), "Sync root {} exists {}", syncTarget, syncTarget.toFile().exists());\r
+ logger.info(getMarker(), "Sync root {} exists {}", syncTarget, Files.exists(syncTarget));\r
\r
- if (!sync.toFile().exists()) {\r
+ if (!Files.exists(sync)) {\r
logger.info(getMarker(), "Skipping {} synchronization, target not exists", sync);\r
return;\r
}\r
}\r
\r
public void ensureFolder(Path filePath) throws IOException {\r
- File folder = filePath.toFile();\r
- if (!folder.exists() || !folder.isDirectory()) {\r
+ if (!Files.exists(filePath) || !Files.isDirectory(filePath)) {\r
try {\r
Set<PosixFilePermission> perms = PosixFilePermissions.fromString("rwxrwxrwx");\r
FileAttribute<Set<PosixFilePermission>> attr = PosixFilePermissions.asFileAttribute(perms);\r