Last change
on this file since 13229 was 13229, checked in by kjdon, 17 years ago |
initial implementation of local library server equivalent - little standalone java gui program that has a few settings and launches tomcat and a browser. Implemented initially by Quan, modified by Katherine
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
642 bytes
|
Line | |
---|
1 | package org.greenstone.server;
|
---|
2 |
|
---|
3 | import java.io.BufferedReader;
|
---|
4 | import java.io.IOException;
|
---|
5 | import java.io.InputStream;
|
---|
6 | import java.io.InputStreamReader;
|
---|
7 |
|
---|
8 | class StreamGobbler extends Thread {
|
---|
9 | InputStream is;
|
---|
10 | String type;
|
---|
11 |
|
---|
12 | StreamGobbler(InputStream is, String type) {
|
---|
13 | this.is = is;
|
---|
14 | this.type = type;
|
---|
15 | }
|
---|
16 |
|
---|
17 | public void run() {
|
---|
18 | try {
|
---|
19 | InputStreamReader isr = new InputStreamReader(is);
|
---|
20 | BufferedReader br = new BufferedReader(isr);
|
---|
21 | String line = null;
|
---|
22 | while ((line = br.readLine()) != null)
|
---|
23 | System.out.println(type + ">" + line);
|
---|
24 | } catch (IOException ioe) {
|
---|
25 | ioe.printStackTrace();
|
---|
26 | }
|
---|
27 | }
|
---|
28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.