Commit 24b660d1 authored by Brian Major's avatar Brian Major
Browse files

issue-10 - GroupURI object cleanup

parent dd119810
......@@ -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;
}
......@@ -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.
*
......@@ -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);
......
......@@ -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());
......@@ -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());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment