annotate src/main/java/de/intevation/artifacts/httpclient/http/response/StringResponseHandler.java @ 32:f314a514de5f

Added some Override annotations. http-client/trunk@4273 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 19 Apr 2012 08:58:07 +0000
parents 0359c4f3b4a1
children
rev   line source
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 /*
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2 * Copyright (c) 2010 by Intevation GmbH
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 *
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 * This program is free software under the LGPL (>=v2.1)
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5 * Read the file LGPL.txt coming with the software for details
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 */
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 package de.intevation.artifacts.httpclient.http.response;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 import java.io.ByteArrayOutputStream;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import java.io.InputStream;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import java.io.IOException;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import java.io.OutputStream;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 import org.restlet.Response;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 /**
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 */
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 public class StringResponseHandler extends StreamResponseHandler {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 public StringResponseHandler() {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
32
f314a514de5f Added some Override annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 13
diff changeset
25 @Override
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 public Object handle(Response response) throws IOException {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 InputStream in = (InputStream) super.handle(response);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 OutputStream out = new ByteArrayOutputStream();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 byte[] b = new byte[4096];
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 int i = -1;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 while ((i = in.read(b)) > 0) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 out.write(b, 0, i);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 out.close();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 return out.toString();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

http://dive4elements.wald.intevation.org