String regionId = cloudFiles.get("region").getAsString();
String publicUrl = cloudFiles.get("publicURL").getAsString();
String cdnUrl = cdnUrls.containsKey(regionId) ? cdnUrls.get(regionId) : null;
Boolean v1Default = cloudFiles.get("v1Default") != null
? cloudFiles.get("v1Default").getAsBoolean() : Boolean.FALSE;
regions.add(new Region(regionId, URI.create(publicUrl), cdnUrl == null ? null : URI.create(cdnUrl), v1Default));
}
return new AuthenticationResponse(response, token, regions);
}
catch(JsonParseException e) {
throw new IOException(e.getMessage(), e);