public static void createConfigFile(URL configURL) {
// XXX
// this is rather krufty
String configName = configURL.toString();
String prefix = "file:";
int index = configName.indexOf(prefix);
if (index > -1) {
configName = configName.substring(index + prefix.length());
}
try {
InputStream is = getConfigAsStream();
FileOutputStream out = new FileOutputStream(configName);
byte[] buf = new byte[1024];
int read = 0;
do {
out.write(buf, 0, read);
read = is.read(buf, 0, buf.length);
} while (read > -1);
is.close();
out.close();
} catch (Exception e) {
}
}
|