Mercurial > dive4elements > http-client
diff src/main/java/org/dive4elements/artifacts/httpclient/http/response/DocumentResponseHandler.java @ 116:c92b50c9c99a
Slightly improved error handling if response entity could not be parsed.
author | gernotbelger |
---|---|
date | Wed, 13 Jun 2018 15:37:12 +0200 |
parents | 133281653904 |
children |
line wrap: on
line diff
--- a/src/main/java/org/dive4elements/artifacts/httpclient/http/response/DocumentResponseHandler.java Mon Dec 28 17:54:40 2015 +0100 +++ b/src/main/java/org/dive4elements/artifacts/httpclient/http/response/DocumentResponseHandler.java Wed Jun 13 15:37:12 2018 +0200 @@ -9,24 +9,19 @@ import java.io.IOException; +import org.dive4elements.artifacts.httpclient.utils.XMLUtils; import org.restlet.Response; import org.restlet.representation.Representation; -import org.dive4elements.artifacts.httpclient.utils.XMLUtils; - - /** * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class DocumentResponseHandler implements ResponseHandler { - public DocumentResponseHandler() { - } - @Override - public Object handle(Response response) throws IOException { - Representation output = response.getEntity(); - return XMLUtils.readDocument(output.getStream()); + public Object handle(final Response response) throws IOException { + final Representation output = response.getEntity(); + // FIXME: stream not closed? + return XMLUtils.readDocument(output.getStream()); } -} -// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: +} \ No newline at end of file