@Test public void testIsExtensionOf() { Path u1 = new UrlImpl(defaultUrl, "/abc"); Path u2 = new UrlImpl("/abc"); assertTrue(u1.isExtensionOf(defaultUrl)); assertTrue(defaultUrl.isExtensionOf(defaultUrl)); assertFalse(u1.isExtensionOf(u2)); assertFalse(u2.isExtensionOf(u1)); }
public boolean isExtensionOf(Path url) { return path.indexOf(url.getPath()) == 0; }
UrlImpl implements Path { public boolean isExtensionOf(Path url) { return path.indexOf(url.getPath()) == 0; } }
UrlImpl implements Path { public boolean isExtensionOf(Path url) { return path.indexOf(url.getPath()) == 0; } UrlImpl(String path);  UrlImpl(Path url, String path);  UrlImpl(String path, char separator); protected  UrlImpl(char separator); }
UrlImpl implements Path { public boolean isExtensionOf(Path url) { return path.indexOf(url.getPath()) == 0; } UrlImpl(String path);  UrlImpl(Path url, String path);  UrlImpl(String path, char separator); protected  UrlImpl(char separator); char getPathSeparator(); void setPath(String path); String getPath(); boolean startsWith(String path); boolean endsWith(String path); boolean isPrefixOf(Path url); boolean isExtensionOf(Path url); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
UrlImpl implements Path { public boolean isExtensionOf(Path url) { return path.indexOf(url.getPath()) == 0; } UrlImpl(String path);  UrlImpl(Path url, String path);  UrlImpl(String path, char separator); protected  UrlImpl(char separator); char getPathSeparator(); void setPath(String path); String getPath(); boolean startsWith(String path); boolean endsWith(String path); boolean isPrefixOf(Path url); boolean isExtensionOf(Path url); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }