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
dd119810
Commit
dd119810
authored
Nov 22, 2016
by
Brian Major
Browse files
issue-10 - refactor GroupURI so constructor does URI reshaping
parent
ad1249e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
cadc-access-control/src/main/java/ca/nrc/cadc/ac/GroupURI.java
View file @
dd119810
...
...
@@ -83,7 +83,6 @@ public class GroupURI
private
static
Logger
log
=
Logger
.
getLogger
(
GroupURI
.
class
);
private
URI
uri
;
private
String
name
;
/**
* Attempts to create a URI using the specified uri.
...
...
@@ -99,8 +98,6 @@ public class GroupURI
throw
new
IllegalArgumentException
(
"Null URI"
);
}
this
.
uri
=
uri
;
// Ensure the scheme is correct
if
(
uri
.
getScheme
()
==
null
)
{
...
...
@@ -117,13 +114,9 @@ public class GroupURI
throw
new
IllegalArgumentException
(
"Missing authority and/or path."
);
}
log
.
debug
(
"URI: "
+
uri
);
log
.
debug
(
" scheme: "
+
uri
.
getScheme
());
log
.
debug
(
" authority: "
+
uri
.
getAuthority
());
log
.
debug
(
" path: "
+
uri
.
getPath
());
String
fragment
=
uri
.
getFragment
();
String
query
=
uri
.
getQuery
();
String
name
=
null
;
if
(
query
==
null
)
{
if
(
fragment
!=
null
)
...
...
@@ -144,6 +137,9 @@ public class GroupURI
}
name
=
query
;
}
this
.
uri
=
URI
.
create
(
uri
.
getScheme
()
+
"://"
+
uri
.
getAuthority
()
+
uri
.
getPath
()
+
"?"
+
name
);
}
/**
...
...
@@ -200,7 +196,7 @@ public class GroupURI
*/
public
String
getName
()
{
return
name
;
return
uri
.
getQuery
()
;
}
public
String
getServiceIDString
()
...
...
@@ -228,7 +224,7 @@ public class GroupURI
@Override
public
String
toString
()
{
return
getServiceID
()
+
"?"
+
name
;
return
uri
.
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