/** * Returns the path simple name: the raw name followed by the extension. * * @return the simple name */ public String getSimpleName() { String ext = getExt(); String rawName = getRawName(); if (ext != null) { return rawName + "." + ext; } else { return rawName; } }
/** * Returns the path simple name: the raw name followed by the extension. * * @return the simple name */ public String getSimpleName() { String ext = getExt(); String rawName = getRawName(); if (ext != null) { return rawName + "." + ext; } else { return rawName; } }
public String getCanonical() { if (canonical == null) { StringBuilder sb = new StringBuilder(); if (isAbsolute()) { sb.append('/'); } for (int i = 0;i < name.size();i++) { if (i > 0) { sb.append('/'); } sb.append(name.get(i)); } String ext = getExt(); if (ext != null) { sb.append('.').append(ext); } canonical = sb.toString(); } return canonical; }
public String getCanonical() { if (canonical == null) { StringBuilder sb = new StringBuilder(); if (isAbsolute()) { sb.append('/'); } for (int i = 0;i < name.size();i++) { if (i > 0) { sb.append('/'); } sb.append(name.get(i)); } String ext = getExt(); if (ext != null) { sb.append('.').append(ext); } canonical = sb.toString(); } return canonical; }
/** * Resolve a path with respect to this name and return an absolute path. * * @param path the path * @return the corresponding absolute path */ public Path.Absolute resolve(Path path) { if (path instanceof Path.Absolute) { return (Path.Absolute)path; } else { return Path.absolute(append(path.getName()), path.getExt()); } }
/** * Resolve a path with respect to this name and return an absolute path. * * @param path the path * @return the corresponding absolute path */ public Path.Absolute resolve(Path path) { if (path instanceof Path.Absolute) { return (Path.Absolute)path; } else { return Path.absolute(append(path.getName()), path.getExt()); } }
private void assertPath(boolean absolute, String[] names, String name, String extension, Path test) { Assert.assertEquals(absolute, test.isAbsolute()); Iterable<String> qn = test.getDirs(); Assert.assertNotNull(qn); Assert.assertEquals(Arrays.asList(names), Tools.list(qn)); Assert.assertEquals(name, test.getRawName()); Assert.assertEquals(extension, test.getExt()); }
private void assertPath(boolean absolute, String[] names, String name, String extension, Path test) { Assert.assertEquals(absolute, test.isAbsolute()); Iterable<String> qn = test.getDirs(); Assert.assertNotNull(qn); Assert.assertEquals(Arrays.asList(names), Tools.list(qn)); Assert.assertEquals(name, test.getRawName()); Assert.assertEquals(extension, test.getExt()); }
File from; String suffix; if (path.getExt() == null) { from = sourcePath.getPath(root, path.getName()); if (from == null) {
File from; String suffix; if (path.getExt() == null) { from = sourcePath.getPath(root, path.getName()); if (from == null) {