@Test public void constructFromComponentsTests() { String scheme = "tachyon"; String authority = "127.0.0.1:90909"; String path = "/a/../b/c.txt"; String absPath = "/b/c.txt"; TachyonURI uri0 = new TachyonURI(null, null, path); Assert.assertEquals(absPath, uri0.toString()); TachyonURI uri1 = new TachyonURI(scheme, null, path); Assert.assertEquals(scheme + ":" + absPath, uri1.toString()); TachyonURI uri2 = new TachyonURI(scheme, authority, path); Assert.assertEquals(scheme + ": TachyonURI uri3 = new TachyonURI(null, authority, path); Assert.assertEquals(" }
@Override public String toString() { StringBuffer sb = new StringBuffer(); if (mUri.getScheme() != null) { sb.append(mUri.getScheme()); sb.append(":"); } if (mUri.getAuthority() != null) { sb.append(" sb.append(mUri.getAuthority()); } if (mUri.getPath() != null) { String path = mUri.getPath(); if (path.indexOf('/') == 0 && hasWindowsDrive(path, true) && mUri.getScheme() == null && mUri.getAuthority() == null) { path = path.substring(1); } sb.append(path); } return sb.toString(); }
TachyonURI implements Comparable<TachyonURI> { @Override public String toString() { StringBuffer sb = new StringBuffer(); if (mUri.getScheme() != null) { sb.append(mUri.getScheme()); sb.append(":"); } if (mUri.getAuthority() != null) { sb.append(" sb.append(mUri.getAuthority()); } if (mUri.getPath() != null) { String path = mUri.getPath(); if (path.indexOf('/') == 0 && hasWindowsDrive(path, true) && mUri.getScheme() == null && mUri.getAuthority() == null) { path = path.substring(1); } sb.append(path); } return sb.toString(); } }
TachyonURI implements Comparable<TachyonURI> { @Override public String toString() { StringBuffer sb = new StringBuffer(); if (mUri.getScheme() != null) { sb.append(mUri.getScheme()); sb.append(":"); } if (mUri.getAuthority() != null) { sb.append(" sb.append(mUri.getAuthority()); } if (mUri.getPath() != null) { String path = mUri.getPath(); if (path.indexOf('/') == 0 && hasWindowsDrive(path, true) && mUri.getScheme() == null && mUri.getAuthority() == null) { path = path.substring(1); } sb.append(path); } return sb.toString(); } TachyonURI(String pathStr);  TachyonURI(String scheme, String authority, String path);  TachyonURI(TachyonURI parent, TachyonURI child); }
TachyonURI implements Comparable<TachyonURI> { @Override public String toString() { StringBuffer sb = new StringBuffer(); if (mUri.getScheme() != null) { sb.append(mUri.getScheme()); sb.append(":"); } if (mUri.getAuthority() != null) { sb.append(" sb.append(mUri.getAuthority()); } if (mUri.getPath() != null) { String path = mUri.getPath(); if (path.indexOf('/') == 0 && hasWindowsDrive(path, true) && mUri.getScheme() == null && mUri.getAuthority() == null) { path = path.substring(1); } sb.append(path); } return sb.toString(); } TachyonURI(String pathStr);  TachyonURI(String scheme, String authority, String path);  TachyonURI(TachyonURI parent, TachyonURI child); @Override int compareTo(TachyonURI other); @Override boolean equals(Object o); String getAuthority(); int getDepth(); String getHost(); String getName(); TachyonURI getParent(); String getPath(); int getPort(); String getScheme(); boolean hasAuthority(); @Override int hashCode(); boolean hasScheme(); boolean isAbsolute(); boolean isPathAbsolute(); TachyonURI join(String suffix); TachyonURI join(TachyonURI suffix); @Override String toString(); }
TachyonURI implements Comparable<TachyonURI> { @Override public String toString() { StringBuffer sb = new StringBuffer(); if (mUri.getScheme() != null) { sb.append(mUri.getScheme()); sb.append(":"); } if (mUri.getAuthority() != null) { sb.append(" sb.append(mUri.getAuthority()); } if (mUri.getPath() != null) { String path = mUri.getPath(); if (path.indexOf('/') == 0 && hasWindowsDrive(path, true) && mUri.getScheme() == null && mUri.getAuthority() == null) { path = path.substring(1); } sb.append(path); } return sb.toString(); } TachyonURI(String pathStr);  TachyonURI(String scheme, String authority, String path);  TachyonURI(TachyonURI parent, TachyonURI child); @Override int compareTo(TachyonURI other); @Override boolean equals(Object o); String getAuthority(); int getDepth(); String getHost(); String getName(); TachyonURI getParent(); String getPath(); int getPort(); String getScheme(); boolean hasAuthority(); @Override int hashCode(); boolean hasScheme(); boolean isAbsolute(); boolean isPathAbsolute(); TachyonURI join(String suffix); TachyonURI join(TachyonURI suffix); @Override String toString(); static final String SEPARATOR; static final String CUR_DIR; }