Changeset 9227 in josm for trunk/src/oauth/signpost
- Timestamp:
- 2015-12-31T03:24:56+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/oauth/signpost/AbstractOAuthProvider.java
r6849 r9227 12 12 13 13 import java.io.BufferedReader; 14 import java.io.InputStream; 14 15 import java.io.InputStreamReader; 15 16 import java.util.HashMap; … … 28 29 * you will probably inherit from this class, since it takes a lot of work from 29 30 * you. 30 * 31 * 31 32 * @author Matthias Kaeppler 32 33 */ … … 128 129 * </ul> 129 130 * </p> 130 * 131 * 131 132 * @param consumer 132 133 * the {@link OAuthConsumer} that should be used to sign the request … … 168 169 consumer.setAdditionalParameters(customOAuthParams); 169 170 } 170 171 171 172 if (this.listener != null) { 172 173 this.listener.prepareRequest(request); … … 174 175 175 176 consumer.sign(request); 176 177 177 178 if (this.listener != null) { 178 179 this.listener.prepareSubmission(request); … … 230 231 return; 231 232 } 232 BufferedReader reader = new BufferedReader(new InputStreamReader(response.getContent()));233 233 StringBuilder responseBody = new StringBuilder(); 234 235 String line = reader.readLine(); 236 while (line != null) { 237 responseBody.append(line); 238 line = reader.readLine(); 234 InputStream content = response.getContent(); 235 if (content != null) { 236 BufferedReader reader = new BufferedReader(new InputStreamReader(content)); 237 238 String line = reader.readLine(); 239 while (line != null) { 240 responseBody.append(line); 241 line = reader.readLine(); 242 } 239 243 } 240 244 … … 251 255 * Overrride this method if you want to customize the logic for building a 252 256 * request object for the given endpoint URL. 253 * 257 * 254 258 * @param endpointUrl 255 259 * the URL to which the request will go … … 263 267 * Override this method if you want to customize the logic for how the given 264 268 * request is sent to the server. 265 * 269 * 266 270 * @param request 267 271 * the request to send … … 275 279 * Called when the connection is being finalized after receiving the 276 280 * response. Use this to do any cleanup / resource freeing. 277 * 281 * 278 282 * @param request 279 283 * the request that has been sent … … 295 299 * token reply. You must call {@link #setResponseParameters} with the set of 296 300 * parameters before using this method. 297 * 301 * 298 302 * @param key 299 303 * the parameter name
Note:
See TracChangeset
for help on using the changeset viewer.