1 /*
2 * SymmetricDS is an open source database synchronization solution.
3 *
4 * Copyright (C) Chris Henson <chenson42@users.sourceforge.net>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see
18 * <http://www.gnu.org/licenses/>.
19 */
20
21 package org.jumpmind.symmetric.transport.http;
22
23 import java.io.BufferedReader;
24 import java.io.BufferedWriter;
25 import java.io.IOException;
26
27 import javax.servlet.http.HttpServletResponse;
28
29 import org.jumpmind.symmetric.transport.IOutgoingTransport;
30
31 public class HttpServletOutgoingTransport implements IOutgoingTransport {
32 private HttpServletResponse response;
33
34 public HttpServletOutgoingTransport(HttpServletResponse resp) {
35 this.response = resp;
36 }
37
38 public void close() throws IOException {
39 }
40
41 public BufferedWriter open() throws IOException {
42 return new BufferedWriter(response.getWriter());
43 }
44
45 public BufferedReader readResponse() throws IOException {
46 throw new UnsupportedOperationException();
47 }
48
49 public boolean isOpen() {
50 return response != null;
51 }
52
53 }