@Test public void processStep_ShouldMoveRootFileToOutputDir() throws Exception { Path temp = createFile(getPath("0", "video.ext")); transcodeFinishedEvent.setTemporaryPath(temp); CleanupContext result = subject.processStep(context); Path expected = getPath("output", "video.ext"); Assertions.assertThat(result.getOutputPath()) .isEqualTo(expected) .exists(); }
@Override public CleanupContext processStep(CleanupContext context) { log.entry(context); TranscodeFinishedEvent result = context.getTranscodeFinishedEvent(); if (isFailed(result)) return log.exit(context); Path source = result.getTemporaryPath(); Path target = cleanupConfig.base_output_dir().resolve(source.getFileName()); context.setOutputPath(moveAndReplaceExisting(source, target, cleanupConfig.overwrite_files())); return log.exit(context); }
UnifiedOutputDirectoryProcessor extends AbstractOutputDirectoryProcessor { @Override public CleanupContext processStep(CleanupContext context) { log.entry(context); TranscodeFinishedEvent result = context.getTranscodeFinishedEvent(); if (isFailed(result)) return log.exit(context); Path source = result.getTemporaryPath(); Path target = cleanupConfig.base_output_dir().resolve(source.getFileName()); context.setOutputPath(moveAndReplaceExisting(source, target, cleanupConfig.overwrite_files())); return log.exit(context); } }
UnifiedOutputDirectoryProcessor extends AbstractOutputDirectoryProcessor { @Override public CleanupContext processStep(CleanupContext context) { log.entry(context); TranscodeFinishedEvent result = context.getTranscodeFinishedEvent(); if (isFailed(result)) return log.exit(context); Path source = result.getTemporaryPath(); Path target = cleanupConfig.base_output_dir().resolve(source.getFileName()); context.setOutputPath(moveAndReplaceExisting(source, target, cleanupConfig.overwrite_files())); return log.exit(context); } @Inject  UnifiedOutputDirectoryProcessor(CleanupConfig cleanupConfig,
                                    Clock clock); }
UnifiedOutputDirectoryProcessor extends AbstractOutputDirectoryProcessor { @Override public CleanupContext processStep(CleanupContext context) { log.entry(context); TranscodeFinishedEvent result = context.getTranscodeFinishedEvent(); if (isFailed(result)) return log.exit(context); Path source = result.getTemporaryPath(); Path target = cleanupConfig.base_output_dir().resolve(source.getFileName()); context.setOutputPath(moveAndReplaceExisting(source, target, cleanupConfig.overwrite_files())); return log.exit(context); } @Inject  UnifiedOutputDirectoryProcessor(CleanupConfig cleanupConfig,
                                    Clock clock); @Override CleanupContext processStep(CleanupContext context); }
UnifiedOutputDirectoryProcessor extends AbstractOutputDirectoryProcessor { @Override public CleanupContext processStep(CleanupContext context) { log.entry(context); TranscodeFinishedEvent result = context.getTranscodeFinishedEvent(); if (isFailed(result)) return log.exit(context); Path source = result.getTemporaryPath(); Path target = cleanupConfig.base_output_dir().resolve(source.getFileName()); context.setOutputPath(moveAndReplaceExisting(source, target, cleanupConfig.overwrite_files())); return log.exit(context); } @Inject  UnifiedOutputDirectoryProcessor(CleanupConfig cleanupConfig,
                                    Clock clock); @Override CleanupContext processStep(CleanupContext context);  }