Revised get avatar helper method
This commit is contained in:
parent
8dc8f1d2a7
commit
35459bec6b
|
@ -274,10 +274,10 @@ public class OpenIdConnectRESTHelper {
|
|||
logger.debug("Adding authorization header as: {}", authorization);
|
||||
conn.setRequestProperty("Authorization", authorization);
|
||||
}
|
||||
if (conn.getResponseCode() == 200) {
|
||||
String contentType = conn.getContentType();
|
||||
int contentLength = conn.getContentLength();
|
||||
|
||||
logger.debug("Getting the stream to a {} bytes lenght resource with MIME: {}", contentLength, contentType);
|
||||
logger.debug("Getting the stream to the avatar resource with MIME: {}", contentType);
|
||||
|
||||
InputStream is = conn.getInputStream();
|
||||
buffer = new ByteArrayOutputStream();
|
||||
|
@ -289,6 +289,9 @@ public class OpenIdConnectRESTHelper {
|
|||
|
||||
buffer.flush();
|
||||
return buffer.toByteArray();
|
||||
} else {
|
||||
logger.debug("Something wrong on the avatar server. Response code: {}", conn.getResponseCode());
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
logger.debug("User's avatar not found");
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Reference in New Issue