@Test public void testGetKey() { assertEquals("d/f", new PathContainerService().getKey(new Path("/c/d/f", EnumSet.of(Path.Type.directory)))); assertNull(new PathContainerService().getKey(new Path("/", EnumSet.of(Path.Type.directory)))); }
public String getKey(final Path file) { if(file.isRoot()) { return null; } if(this.isContainer(file)) { return null; } return PathRelativizer.relativize(this.getContainer(file).getAbsolute(), file.getAbsolute()); }
PathContainerService { public String getKey(final Path file) { if(file.isRoot()) { return null; } if(this.isContainer(file)) { return null; } return PathRelativizer.relativize(this.getContainer(file).getAbsolute(), file.getAbsolute()); } }
PathContainerService { public String getKey(final Path file) { if(file.isRoot()) { return null; } if(this.isContainer(file)) { return null; } return PathRelativizer.relativize(this.getContainer(file).getAbsolute(), file.getAbsolute()); }  }
PathContainerService { public String getKey(final Path file) { if(file.isRoot()) { return null; } if(this.isContainer(file)) { return null; } return PathRelativizer.relativize(this.getContainer(file).getAbsolute(), file.getAbsolute()); }  Path getRoot(final Path file); boolean isContainer(final Path file); Path getContainer(final Path file); String getKey(final Path file); }
PathContainerService { public String getKey(final Path file) { if(file.isRoot()) { return null; } if(this.isContainer(file)) { return null; } return PathRelativizer.relativize(this.getContainer(file).getAbsolute(), file.getAbsolute()); }  Path getRoot(final Path file); boolean isContainer(final Path file); Path getContainer(final Path file); String getKey(final Path file);  }