41 |
|
|
42 |
import java.io.BufferedInputStream; |
import java.io.BufferedInputStream; |
43 |
import java.io.BufferedOutputStream; |
import java.io.BufferedOutputStream; |
44 |
|
import java.io.ByteArrayInputStream; |
45 |
import java.io.File; |
import java.io.File; |
46 |
import java.io.FileInputStream; |
import java.io.FileInputStream; |
47 |
import java.io.FileOutputStream; |
import java.io.FileOutputStream; |
49 |
import java.io.InputStream; |
import java.io.InputStream; |
50 |
import java.io.IOException; |
import java.io.IOException; |
51 |
import java.io.OutputStream; |
import java.io.OutputStream; |
|
import java.io.StringBufferInputStream; |
|
52 |
import java.net.ProtocolException; |
import java.net.ProtocolException; |
53 |
import java.net.URL; |
import java.net.URL; |
54 |
import java.net.URLConnection; |
import java.net.URLConnection; |
74 |
*/ |
*/ |
75 |
private static final String DEFAULT_PERMISSION = "read"; |
private static final String DEFAULT_PERMISSION = "read"; |
76 |
|
|
77 |
private static final String lineSeparator; |
private static String lineSeparator; |
|
|
|
|
static |
|
|
{ |
|
|
GetPropertyAction getProperty = new GetPropertyAction("line.separator"); |
|
|
lineSeparator = (String) AccessController.doPrivileged(getProperty); |
|
|
|
|
|
} |
|
78 |
|
|
79 |
/** |
/** |
80 |
* This is a File object for this connection |
* This is a File object for this connection |
130 |
{ |
{ |
131 |
if (doInput) |
if (doInput) |
132 |
{ |
{ |
133 |
|
if (lineSeparator == null) |
134 |
|
{ |
135 |
|
GetPropertyAction getProperty = new GetPropertyAction("line.separator"); |
136 |
|
lineSeparator = (String) AccessController.doPrivileged(getProperty); |
137 |
|
} |
138 |
|
|
139 |
StringBuffer sb = new StringBuffer(); |
StringBuffer sb = new StringBuffer(); |
140 |
String[] files = file.list(); |
String[] files = file.list(); |
141 |
|
|
142 |
for (int index = 0; index < files.length; ++index) |
for (int index = 0; index < files.length; ++index) |
143 |
sb.append(files[index]).append(lineSeparator); |
sb.append(files[index]).append(lineSeparator); |
144 |
|
|
145 |
inputStream = new StringBufferInputStream(sb.toString()); |
inputStream = new ByteArrayInputStream(sb.toString().getBytes()); |
146 |
} |
} |
147 |
|
|
148 |
if (doOutput) |
if (doOutput) |