Move return statement

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-access/gcube-geoserver-connector@149215 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
pasquale.vitale 2017-05-29 15:25:40 +00:00
parent cf80f74993
commit 3eec7460a2
1 changed files with 3 additions and 2 deletions

View File

@ -8,13 +8,14 @@ import org.springframework.web.client.RestTemplate;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
public class GCubeRestClient { public class GCubeRestClient {
private Logger logger = LoggerFactory.getLogger(this.getClass()); private Logger logger = LoggerFactory.getLogger(this.getClass());
public AccessibleCredentialsEntity getAccessibleCredentials(String url) { public AccessibleCredentialsEntity getAccessibleCredentials(String url) {
logger.warn("REST call to URL: " + url); logger.warn("REST call to URL: " + url);
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
try { try {
String response = restTemplate.getForObject(url, String.class); String response = restTemplate.getForObject(url, String.class);
logger.warn("JSON response: \n" + response); logger.warn("JSON response: \n" + response);
@ -23,8 +24,8 @@ public class GCubeRestClient {
return (AccessibleCredentialsEntity) JSONObject.toBean(jsonObject, AccessibleCredentialsEntity.class); return (AccessibleCredentialsEntity) JSONObject.toBean(jsonObject, AccessibleCredentialsEntity.class);
} catch (Exception e) { } catch (Exception e) {
logger.error("Error in getAccessibleCredentials() method: " + e.getMessage()); logger.error("Error in getAccessibleCredentials() method: " + e.getMessage());
return new AccessibleCredentialsEntity();
} }
return new AccessibleCredentialsEntity();
} }
} }