@Test public void normalizeTests() { Assert.assertEquals("/", new TachyonURI(" Assert.assertEquals("/foo", new TachyonURI("/foo/").toString()); Assert.assertEquals("/foo", new TachyonURI("/foo/").toString()); Assert.assertEquals("foo", new TachyonURI("foo/").toString()); Assert.assertEquals("foo", new TachyonURI("foo Assert.assertEquals("foo/bar", new TachyonURI("foo Assert.assertEquals("foo/boo", new TachyonURI("foo/bar/.. Assert.assertEquals("foo/boo/baz", new TachyonURI("foo/bar/.. Assert.assertEquals("../foo/boo", new TachyonURI("../foo/bar/.. Assert.assertEquals("/../foo/boo", new TachyonURI("/.././foo/boo").toString()); Assert.assertEquals("foo/boo", new TachyonURI("./foo/boo").toString()); Assert.assertEquals("c:/a/b", new TachyonURI("c:\\a\\b").toString()); Assert.assertEquals("c:/a/c", new TachyonURI("c:\\a\\b\\..\\c").toString()); Assert.assertEquals("foo: new TachyonURI("foo: }
@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; }