From fafd4418ada5c3db0b1076216fa7b389af25ba99 Mon Sep 17 00:00:00 2001 From: Sweidan Omar Date: Fri, 21 Jan 2022 08:55:01 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C32855 --- .../MEDIAVIVANTIS/jobs/steps/TranscodeFFAStranStep.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/TranscodeFFAStranStep.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/TranscodeFFAStranStep.java index a73ff663..d09685bc 100644 --- a/server/-product/production/MEDIAVIVANTIS/jobs/steps/TranscodeFFAStranStep.java +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/TranscodeFFAStranStep.java @@ -70,7 +70,7 @@ public class TranscodeFFAStranStep extends JobStep { try { String targetFileName = FilenameUtils.removeExtension(sourceFileName) + MP4EXT; targetPath = Paths.get(localLowresTargetPath, targetFileName); - if (!targetPath.toFile().exists()) { + if (!Files.exists(targetPath)) { // jobRuntime.setDescription(String.format("%s: %s", jobRuntime.getDescription(), details)); jobRuntime.setDescription(String.format("%s transzkódolása", details)); String sourceFile = Paths.get(globalHiresSourcePath, sourceFileName).toString(); @@ -85,7 +85,7 @@ public class TranscodeFFAStranStep extends JobStep { //a sikeres transzkod utan nem mindig van ott egybol a fajl long started = System.currentTimeMillis(); - while (!targetPath.toFile().exists()) { + while (!Files.exists(targetPath)) { long current = System.currentTimeMillis(); //max 5 perc varakozas if (current - started > 5 * 60 * 1000) @@ -108,7 +108,7 @@ public class TranscodeFFAStranStep extends JobStep { logger.catching(e); } try { - if (deleteSource && targetPath != null && targetPath.toFile().exists()) + if (deleteSource && targetPath != null && Files.exists(targetPath)) Files.delete(targetPath); } catch (Exception e) { logger.catching(e); @@ -131,7 +131,7 @@ public class TranscodeFFAStranStep extends JobStep { } lowresPath = Paths.get(webPath, targetPath); int version = 1; - while (lowresPath.toFile().exists()) { + while (Files.exists(lowresPath)) { String fileName = transcodedFileName + version + MP4EXT; lowresPath = Paths.get(lowresPath.toString().replace(transcodedFileName, fileName)); targetPath = targetPath.replace(transcodedFileName, fileName); -- 2.54.0