org.resthub.web.support.AsyncEntityHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resthub-web-client Show documentation
Show all versions of resthub-web-client Show documentation
RESThub webservice client for requesting REST webservices with JSON support bundled
The newest version!
package org.resthub.web.support;
import com.ning.http.client.AsyncCompletionHandler;
import org.resthub.web.Response;
import java.util.ArrayList;
import java.util.List;
public class AsyncEntityHandler extends AsyncCompletionHandler {
protected List bodyReaders = new ArrayList();
public void setBodyReaders(List brs) {
this.bodyReaders = brs;
}
public void addBodyReader(BodyReader br) {
this.bodyReaders.add(br);
}
@Override
public Response onCompleted(com.ning.http.client.Response rspns) throws Exception {
Response resp = new Response(rspns);
resp.addBodyReaders(this.bodyReaders);
return resp;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy