@Test public void getTargetWithoutSuffix() throws IOException{ Path modules = Paths.get("/location/modules/mymodule"); Path file = PathUtils.get(modules, "@manydirs@/test.txt.delete"); PathHelper vpu = new PathHelper(conf, modules); Path result = vpu.getTargetWithoutSuffix(file, ".delete"); assertThat(result, is(PathUtils.get("/a/b/c/test.txt"))); }
public final Path getTargetWithoutSuffix(Path path, final String sufix) { String fileName = path.getFileName().toString(); fileName = fileName.replaceAll(sufix, ""); path = path.resolveSibling(fileName); return getTarget(path); }
PathHelper { public final Path getTargetWithoutSuffix(Path path, final String sufix) { String fileName = path.getFileName().toString(); fileName = fileName.replaceAll(sufix, ""); path = path.resolveSibling(fileName); return getTarget(path); } }
PathHelper { public final Path getTargetWithoutSuffix(Path path, final String sufix) { String fileName = path.getFileName().toString(); fileName = fileName.replaceAll(sufix, ""); path = path.resolveSibling(fileName); return getTarget(path); } PathHelper(final Configuration conf);   PathHelper(final Map<String, Object> properties, final Path module); }
PathHelper { public final Path getTargetWithoutSuffix(Path path, final String sufix) { String fileName = path.getFileName().toString(); fileName = fileName.replaceAll(sufix, ""); path = path.resolveSibling(fileName); return getTarget(path); } PathHelper(final Configuration conf);   PathHelper(final Map<String, Object> properties, final Path module); final Path getTargetWithoutSuffix(Path path, final String sufix); final Path getTarget(final Path path); final Path replaceVars(final Path path); String replaceVars(String srcPath); }
PathHelper { public final Path getTargetWithoutSuffix(Path path, final String sufix) { String fileName = path.getFileName().toString(); fileName = fileName.replaceAll(sufix, ""); path = path.resolveSibling(fileName); return getTarget(path); } PathHelper(final Configuration conf);   PathHelper(final Map<String, Object> properties, final Path module); final Path getTargetWithoutSuffix(Path path, final String sufix); final Path getTarget(final Path path); final Path replaceVars(final Path path); String replaceVars(String srcPath);  }