@Test public void toStringTests() { String[] uris = new String[] { "/", "/a", "/a/ b", "tachyon:/a/b/c d.txt", "tachyon: "c:/", "c:/foo/bar", "C:/foo/bar#boo", "C:/foo/ bar" }; for (String uri : uris) { TachyonURI turi = new TachyonURI(uri); Assert.assertEquals(uri, turi.toString()); } Assert.assertEquals("", new TachyonURI(".").toString()); Assert.assertEquals("C:/", new TachyonURI("C:\\\\").toString()); Assert.assertEquals("C: Assert.assertEquals("file:/a", new TachyonURI("file:/a").toString()); Assert.assertEquals("file:/a", new TachyonURI("file: Assert.assertEquals("file:/a", new TachyonURI("file", null, "/a").toString()); }
@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; }