List of usage examples for org.springframework.security.oauth.consumer OAuthConsumerSupport readProtectedResource
InputStream readProtectedResource(URL url, OAuthConsumerToken accessToken, String httpMethod)
throws OAuthRequestFailedException;
From source file:org.kuali.mobility.events.service.CalendarEventServiceImpl.java
private String getProtectedResource(String url, OAuthConsumerSupport consumerSupport, OAuthConsumerToken accessToken) throws OAuthRequestFailedException, IOException { InputStream is = consumerSupport.readProtectedResource(new URL(url), accessToken, "GET"); if (is != null) { String output = ""; try {//from w w w . j av a 2 s. c o m BufferedReader myInput = new BufferedReader(new InputStreamReader(is)); String currentLine = null; while ((currentLine = myInput.readLine()) != null) { output = output + currentLine; } } finally { is.close(); } return output; } return ""; }