@Test public void processStep_ShouldDeleteSourceFile_IfFileExists() throws Exception { Path source = createFile(getPath("0", "video.ext")); media.setSourcePath(source); subject.processStep(context); assertThat(inputDir.resolve(source)).doesNotExist(); }
@Override public CleanupContext processStep(CleanupContext context) { log.entry(context); Path source = cleanupConfig.base_input_dir().resolve( context.getTranscodeFinishedEvent().getMedia().getSourcePath()); if (!context.getTranscodeFinishedEvent().isSuccessful()) { log.warn("Not deleting {}, since transcoding failed.", source); return log.exit(context); } deleteFile(source); return log.exit(context); }
DeleteSourceProcessor implements CleanupProcessor { @Override public CleanupContext processStep(CleanupContext context) { log.entry(context); Path source = cleanupConfig.base_input_dir().resolve( context.getTranscodeFinishedEvent().getMedia().getSourcePath()); if (!context.getTranscodeFinishedEvent().isSuccessful()) { log.warn("Not deleting {}, since transcoding failed.", source); return log.exit(context); } deleteFile(source); return log.exit(context); } }
DeleteSourceProcessor implements CleanupProcessor { @Override public CleanupContext processStep(CleanupContext context) { log.entry(context); Path source = cleanupConfig.base_input_dir().resolve( context.getTranscodeFinishedEvent().getMedia().getSourcePath()); if (!context.getTranscodeFinishedEvent().isSuccessful()) { log.warn("Not deleting {}, since transcoding failed.", source); return log.exit(context); } deleteFile(source); return log.exit(context); } @Inject  DeleteSourceProcessor(CleanupConfig cleanupConfig); }
DeleteSourceProcessor implements CleanupProcessor { @Override public CleanupContext processStep(CleanupContext context) { log.entry(context); Path source = cleanupConfig.base_input_dir().resolve( context.getTranscodeFinishedEvent().getMedia().getSourcePath()); if (!context.getTranscodeFinishedEvent().isSuccessful()) { log.warn("Not deleting {}, since transcoding failed.", source); return log.exit(context); } deleteFile(source); return log.exit(context); } @Inject  DeleteSourceProcessor(CleanupConfig cleanupConfig); @Override CleanupContext processStep(CleanupContext context); }
DeleteSourceProcessor implements CleanupProcessor { @Override public CleanupContext processStep(CleanupContext context) { log.entry(context); Path source = cleanupConfig.base_input_dir().resolve( context.getTranscodeFinishedEvent().getMedia().getSourcePath()); if (!context.getTranscodeFinishedEvent().isSuccessful()) { log.warn("Not deleting {}, since transcoding failed.", source); return log.exit(context); } deleteFile(source); return log.exit(context); } @Inject  DeleteSourceProcessor(CleanupConfig cleanupConfig); @Override CleanupContext processStep(CleanupContext context);  }