@Test public void createOutputDirectoryTree_ShouldRecreateDirectoryTree_WithSubdirectories() throws Exception { Path source = getPath("0", "subdir1", "subdir2", "file.ext"); Path expected = outputDir.resolve("subdir1").resolve("subdir2").resolve("file.ext"); Path result = subject.createOutputDirectoryTree(source); assertThat(result) .isEqualTo(expected) .hasParentRaw(expected.getParent()); }
Path createOutputDirectoryTree(Path mediaSource) { Path relativeParent = mediaSource.subpath(1, mediaSource.getNameCount()); Path target = cleanupConfig.base_output_dir().resolve(relativeParent); FileUtil.createParentDirectoriesFor(target); return target; }
StructuredOutputDirectoryProcessor extends AbstractOutputDirectoryProcessor { Path createOutputDirectoryTree(Path mediaSource) { Path relativeParent = mediaSource.subpath(1, mediaSource.getNameCount()); Path target = cleanupConfig.base_output_dir().resolve(relativeParent); FileUtil.createParentDirectoriesFor(target); return target; } }
StructuredOutputDirectoryProcessor extends AbstractOutputDirectoryProcessor { Path createOutputDirectoryTree(Path mediaSource) { Path relativeParent = mediaSource.subpath(1, mediaSource.getNameCount()); Path target = cleanupConfig.base_output_dir().resolve(relativeParent); FileUtil.createParentDirectoriesFor(target); return target; } @Inject  StructuredOutputDirectoryProcessor(CleanupConfig cleanupConfig,
                                       Clock clock); }
StructuredOutputDirectoryProcessor extends AbstractOutputDirectoryProcessor { Path createOutputDirectoryTree(Path mediaSource) { Path relativeParent = mediaSource.subpath(1, mediaSource.getNameCount()); Path target = cleanupConfig.base_output_dir().resolve(relativeParent); FileUtil.createParentDirectoriesFor(target); return target; } @Inject  StructuredOutputDirectoryProcessor(CleanupConfig cleanupConfig,
                                       Clock clock); @Override CleanupContext processStep(CleanupContext context); }
StructuredOutputDirectoryProcessor extends AbstractOutputDirectoryProcessor { Path createOutputDirectoryTree(Path mediaSource) { Path relativeParent = mediaSource.subpath(1, mediaSource.getNameCount()); Path target = cleanupConfig.base_output_dir().resolve(relativeParent); FileUtil.createParentDirectoriesFor(target); return target; } @Inject  StructuredOutputDirectoryProcessor(CleanupConfig cleanupConfig,
                                       Clock clock); @Override CleanupContext processStep(CleanupContext context);  }