@Test public void testFindContainerSelected() { assertEquals(new Path("/container", EnumSet.of(Path.Type.directory, Path.Type.volume)), new UploadTargetFinder(new Path("/", EnumSet.of(Path.Type.directory))) .find(new Path("/container", EnumSet.of(Path.Type.directory, Path.Type.volume)))); assertEquals(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), new UploadTargetFinder(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume))) .find(null)); }
public Path find(final Path selected) { if(null == selected) { return workdir; } if(selected.getType().contains(Path.Type.volume)) { return selected; } return selected.getParent(); }
UploadTargetFinder { public Path find(final Path selected) { if(null == selected) { return workdir; } if(selected.getType().contains(Path.Type.volume)) { return selected; } return selected.getParent(); } }
UploadTargetFinder { public Path find(final Path selected) { if(null == selected) { return workdir; } if(selected.getType().contains(Path.Type.volume)) { return selected; } return selected.getParent(); } UploadTargetFinder(final Path workdir); }
UploadTargetFinder { public Path find(final Path selected) { if(null == selected) { return workdir; } if(selected.getType().contains(Path.Type.volume)) { return selected; } return selected.getParent(); } UploadTargetFinder(final Path workdir); Path find(final Path selected); }
UploadTargetFinder { public Path find(final Path selected) { if(null == selected) { return workdir; } if(selected.getType().contains(Path.Type.volume)) { return selected; } return selected.getParent(); } UploadTargetFinder(final Path workdir); Path find(final Path selected);  }