Loading cadc-access-control/src/main/java/ca/nrc/cadc/ac/GroupURI.java +4 −22 Original line number Diff line number Diff line Loading @@ -160,11 +160,8 @@ public class GroupURI return true; if (other instanceof GroupURI) { GroupURI oID = (GroupURI) other; String otherURI = getServiceIDString() + "?" + oID.getName(); String thisURI = getServiceIDString() + "?" + this.getName(); return thisURI.equals(otherURI); GroupURI otherURI = (GroupURI) other; return uri.equals(otherURI.getURI()); } return false; } Loading @@ -179,16 +176,6 @@ public class GroupURI return uri; } /** * Returns the decoded authority component of the URI. * * @return authority of the URI, or null if the authority is undefined. */ public String getAuthority() { return uri.getAuthority(); } /** * Returns the decoded fragment component of the URI. * Loading @@ -199,17 +186,12 @@ public class GroupURI return uri.getQuery(); } public String getServiceIDString() public URI getServiceID() { return uri.getScheme() + String serviceIDString = uri.getScheme() + "://" + uri.getAuthority() + uri.getPath(); } public URI getServiceID() { String serviceIDString = getServiceIDString(); try { return new URI(serviceIDString); Loading cadc-access-control/src/test/java/ca/nrc/cadc/ac/GroupURITest.java +0 −2 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ public class GroupURITest { GroupURI g = new GroupURI("ivo://my.authority/gms?name"); Assert.assertEquals("ivo", g.getURI().getScheme()); Assert.assertEquals("my.authority", g.getAuthority()); Assert.assertEquals("/gms", g.getURI().getPath()); Assert.assertEquals("name", g.getName()); Assert.assertEquals("ivo://my.authority/gms", g.getServiceID().toString()); Loading @@ -77,7 +76,6 @@ public class GroupURITest { GroupURI g = new GroupURI("ivo://my.authority/gms#name"); Assert.assertEquals("ivo", g.getURI().getScheme()); Assert.assertEquals("my.authority", g.getAuthority()); Assert.assertEquals("/gms", g.getURI().getPath()); Assert.assertEquals("name", g.getName()); Assert.assertEquals("ivo://my.authority/gms", g.getServiceID().toString()); Loading Loading
cadc-access-control/src/main/java/ca/nrc/cadc/ac/GroupURI.java +4 −22 Original line number Diff line number Diff line Loading @@ -160,11 +160,8 @@ public class GroupURI return true; if (other instanceof GroupURI) { GroupURI oID = (GroupURI) other; String otherURI = getServiceIDString() + "?" + oID.getName(); String thisURI = getServiceIDString() + "?" + this.getName(); return thisURI.equals(otherURI); GroupURI otherURI = (GroupURI) other; return uri.equals(otherURI.getURI()); } return false; } Loading @@ -179,16 +176,6 @@ public class GroupURI return uri; } /** * Returns the decoded authority component of the URI. * * @return authority of the URI, or null if the authority is undefined. */ public String getAuthority() { return uri.getAuthority(); } /** * Returns the decoded fragment component of the URI. * Loading @@ -199,17 +186,12 @@ public class GroupURI return uri.getQuery(); } public String getServiceIDString() public URI getServiceID() { return uri.getScheme() + String serviceIDString = uri.getScheme() + "://" + uri.getAuthority() + uri.getPath(); } public URI getServiceID() { String serviceIDString = getServiceIDString(); try { return new URI(serviceIDString); Loading
cadc-access-control/src/test/java/ca/nrc/cadc/ac/GroupURITest.java +0 −2 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ public class GroupURITest { GroupURI g = new GroupURI("ivo://my.authority/gms?name"); Assert.assertEquals("ivo", g.getURI().getScheme()); Assert.assertEquals("my.authority", g.getAuthority()); Assert.assertEquals("/gms", g.getURI().getPath()); Assert.assertEquals("name", g.getName()); Assert.assertEquals("ivo://my.authority/gms", g.getServiceID().toString()); Loading @@ -77,7 +76,6 @@ public class GroupURITest { GroupURI g = new GroupURI("ivo://my.authority/gms#name"); Assert.assertEquals("ivo", g.getURI().getScheme()); Assert.assertEquals("my.authority", g.getAuthority()); Assert.assertEquals("/gms", g.getURI().getPath()); Assert.assertEquals("name", g.getName()); Assert.assertEquals("ivo://my.authority/gms", g.getServiceID().toString()); Loading