git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorSweidan Omar <TFS\sweidan.omar>
Fri, 21 Jan 2022 01:55:07 +0000 (01:55 +0000)
committerSweidan Omar <TFS\sweidan.omar>
Fri, 21 Jan 2022 01:55:07 +0000 (01:55 +0000)
server/-product/production/AMC/jobs/steps/ArchiveSubtitlesStep.java

index 4afb09b77e4418ec6a298c0b0093ef9227f0045b..e5895f8cd798aae0d3f111fb8f6823c96b5ded35 100644 (file)
@@ -47,7 +47,7 @@ public class ArchiveSubtitlesStep extends JobStep {
 \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
@@ -74,9 +74,9 @@ public class ArchiveSubtitlesStep extends JobStep {
 \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
@@ -96,8 +96,7 @@ public class ArchiveSubtitlesStep extends JobStep {
        }\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