Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ac
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OATS-CADC
ac
Commits
6957200d
Commit
6957200d
authored
10 years ago
by
Adrian Damian
Browse files
Options
Downloads
Plain Diff
Merge branch 's1666' into s1711
parents
73d8f195
a10a124d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/cadcAccessControl/src/ca/nrc/cadc/ac/client/GMSClient.java
+14
-11
14 additions, 11 deletions
...adcAccessControl/src/ca/nrc/cadc/ac/client/GMSClient.java
with
14 additions
and
11 deletions
projects/cadcAccessControl/src/ca/nrc/cadc/ac/client/GMSClient.java
+
14
−
11
View file @
6957200d
...
...
@@ -78,6 +78,7 @@ import java.net.HttpURLConnection;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.net.URLEncoder
;
import
java.nio.charset.Charset
;
import
java.security.AccessControlContext
;
import
java.security.AccessControlException
;
import
java.security.AccessController
;
...
...
@@ -313,15 +314,13 @@ public class GMSClient
URL
getGroupNamesURL
=
new
URL
(
this
.
baseURL
+
"/groups"
);
log
.
debug
(
"getGroupNames request to "
+
getGroupNamesURL
.
toString
());
HttpURLConnection
conn
=
(
HttpURLConnection
)
getGroupNamesURL
.
openConnection
();
HttpURLConnection
conn
=
(
HttpURLConnection
)
getGroupNamesURL
.
openConnection
();
conn
.
setRequestMethod
(
"GET"
);
SSLSocketFactory
sf
=
getSSLSocketFactory
();
if
((
sf
!=
null
)
&&
((
conn
instanceof
HttpsURLConnection
)))
{
((
HttpsURLConnection
)
conn
)
.
setSSLSocketFactory
(
sf
);
((
HttpsURLConnection
)
conn
).
setSSLSocketFactory
(
sf
);
}
int
responseCode
=
-
1
;
try
...
...
@@ -332,11 +331,12 @@ public class GMSClient
{
throw
new
AccessControlException
(
e
.
getMessage
());
}
log
.
debug
(
"getGroupNames response "
+
responseCode
);
if
(
responseCode
!=
200
)
{
String
errMessage
=
NetUtil
.
getErrorBody
(
conn
);
log
.
debug
(
"
del
et
e
Group response "
+
responseCode
+
": "
+
log
.
debug
(
"
g
etGroup
Names
response "
+
responseCode
+
": "
+
errMessage
);
if
((
responseCode
==
401
)
||
(
responseCode
==
403
)
||
...
...
@@ -351,16 +351,19 @@ public class GMSClient
throw
new
IOException
(
"HttpResponse ("
+
responseCode
+
") - "
+
errMessage
);
}
log
.
error
(
"Content-Length: "
+
conn
.
getHeaderField
(
"Content-Length"
));
log
.
error
(
"Content-Type: "
+
conn
.
getHeaderField
(
"Content-Type"
));
try
{
List
<
String
>
groupNames
=
new
ArrayList
<
String
>();
Reader
ioReader
=
new
InputStreamReader
(
conn
.
getInputStream
());
BufferedReader
br
=
new
BufferedReader
(
ioReader
);
CsvReader
reader
=
new
CsvReader
(
br
);
for
(
int
i
=
0
;
i
<
reader
.
getColumnCount
();
i
++)
CsvReader
reader
=
new
CsvReader
(
conn
.
getInputStream
(),
','
,
Charset
.
forName
(
"UTF-8"
));
if
(
reader
.
readRecord
())
{
groupNames
.
add
(
reader
.
get
(
i
));
for
(
int
i
=
0
;
i
<
reader
.
getColumnCount
();
i
++)
{
groupNames
.
add
(
reader
.
get
(
i
));
}
}
return
groupNames
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment