Skip to content
Snippets Groups Projects
Commit 24b660d1 authored by Brian Major's avatar Brian Major
Browse files

issue-10 - GroupURI object cleanup

parent dd119810
No related branches found
No related tags found
No related merge requests found
...@@ -160,11 +160,8 @@ public class GroupURI ...@@ -160,11 +160,8 @@ public class GroupURI
return true; return true;
if (other instanceof GroupURI) if (other instanceof GroupURI)
{ {
GroupURI otherURI = (GroupURI) other;
GroupURI oID = (GroupURI) other; return uri.equals(otherURI.getURI());
String otherURI = getServiceIDString() + "?" + oID.getName();
String thisURI = getServiceIDString() + "?" + this.getName();
return thisURI.equals(otherURI);
} }
return false; return false;
} }
...@@ -179,16 +176,6 @@ public class GroupURI ...@@ -179,16 +176,6 @@ public class GroupURI
return uri; 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. * Returns the decoded fragment component of the URI.
* *
...@@ -199,17 +186,12 @@ public class GroupURI ...@@ -199,17 +186,12 @@ public class GroupURI
return uri.getQuery(); return uri.getQuery();
} }
public String getServiceIDString() public URI getServiceID()
{ {
return uri.getScheme() + String serviceIDString = uri.getScheme() +
"://" + "://" +
uri.getAuthority() + uri.getAuthority() +
uri.getPath(); uri.getPath();
}
public URI getServiceID()
{
String serviceIDString = getServiceIDString();
try try
{ {
return new URI(serviceIDString); return new URI(serviceIDString);
......
...@@ -58,7 +58,6 @@ public class GroupURITest ...@@ -58,7 +58,6 @@ public class GroupURITest
{ {
GroupURI g = new GroupURI("ivo://my.authority/gms?name"); GroupURI g = new GroupURI("ivo://my.authority/gms?name");
Assert.assertEquals("ivo", g.getURI().getScheme()); Assert.assertEquals("ivo", g.getURI().getScheme());
Assert.assertEquals("my.authority", g.getAuthority());
Assert.assertEquals("/gms", g.getURI().getPath()); Assert.assertEquals("/gms", g.getURI().getPath());
Assert.assertEquals("name", g.getName()); Assert.assertEquals("name", g.getName());
Assert.assertEquals("ivo://my.authority/gms", g.getServiceID().toString()); Assert.assertEquals("ivo://my.authority/gms", g.getServiceID().toString());
...@@ -77,7 +76,6 @@ public class GroupURITest ...@@ -77,7 +76,6 @@ public class GroupURITest
{ {
GroupURI g = new GroupURI("ivo://my.authority/gms#name"); GroupURI g = new GroupURI("ivo://my.authority/gms#name");
Assert.assertEquals("ivo", g.getURI().getScheme()); Assert.assertEquals("ivo", g.getURI().getScheme());
Assert.assertEquals("my.authority", g.getAuthority());
Assert.assertEquals("/gms", g.getURI().getPath()); Assert.assertEquals("/gms", g.getURI().getPath());
Assert.assertEquals("name", g.getName()); Assert.assertEquals("name", g.getName());
Assert.assertEquals("ivo://my.authority/gms", g.getServiceID().toString()); Assert.assertEquals("ivo://my.authority/gms", g.getServiceID().toString());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment