Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OATS-CADC
ac
Commits
24b660d1
Commit
24b660d1
authored
Nov 22, 2016
by
Brian Major
Browse files
issue-10 - GroupURI object cleanup
parent
dd119810
Changes
2
Show whitespace changes
Inline
Side-by-side
cadc-access-control/src/main/java/ca/nrc/cadc/ac/GroupURI.java
View file @
24b660d1
...
...
@@ -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
getServiceID
String
()
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
);
...
...
cadc-access-control/src/test/java/ca/nrc/cadc/ac/GroupURITest.java
View file @
24b660d1
...
...
@@ -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
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment