@@ -34,21 +34,35 @@ public void close() throws IOException {
3434 public <T > Future <T > executeAsync (String userAgent , Map <String , String > headers , Verb httpVerb , String completeUrl ,
3535 byte [] bodyContents , OAuthAsyncRequestCallback <T > callback ,
3636 OAuthRequestAsync .ResponseConverter <T > converter ) {
37- throw new UnsupportedOperationException ("Not supported yet." );
37+ try {
38+ final T response = converter .convert (execute (userAgent , headers , httpVerb , completeUrl , bodyContents ));
39+ callback .onCompleted (response );
40+ return new JDKHttpFuture <>(response );
41+ } catch (InterruptedException | ExecutionException | IOException e ) {
42+ callback .onThrowable (e );
43+ return new JDKHttpFuture <>(e );
44+ }
3845 }
3946
4047 @ Override
4148 public <T > Future <T > executeAsync (String userAgent , Map <String , String > headers , Verb httpVerb , String completeUrl ,
4249 String bodyContents , OAuthAsyncRequestCallback <T > callback ,
4350 OAuthRequestAsync .ResponseConverter <T > converter ) {
44- throw new UnsupportedOperationException ("Not supported yet." );
51+ try {
52+ final T response = converter .convert (execute (userAgent , headers , httpVerb , completeUrl , bodyContents ));
53+ callback .onCompleted (response );
54+ return new JDKHttpFuture <>(response );
55+ } catch (InterruptedException | ExecutionException | IOException e ) {
56+ callback .onThrowable (e );
57+ return new JDKHttpFuture <>(e );
58+ }
4559 }
4660
4761 @ Override
4862 public <T > Future <T > executeAsync (String userAgent , Map <String , String > headers , Verb httpVerb , String completeUrl ,
4963 File bodyContents , OAuthAsyncRequestCallback <T > callback ,
5064 OAuthRequestAsync .ResponseConverter <T > converter ) {
51- throw new UnsupportedOperationException ("Not supported yet. " );
65+ throw new UnsupportedOperationException ("JDKHttpClient do not support File payload for the moment " );
5266 }
5367
5468 @ Override
0 commit comments