} catch (Exception e) {
}
}
}
ProcessInfo pinf = null;
cmd = "cat > " + file;
log.debug(cmd);
if (shell != null) {
pinf = shell.execute(cmd);
sos = new ShellOutputStream(shell, pinf.procid);
} else {
pinf = rshell.execute(cmd);
sos = new ShellOutputStream(rshell, pinf.procid);
}
osw = new OutputStreamWriter(sos, "UTF-8");
osw.write(content);
log.log(NOTICE, "Created file " + file + ", processed " + content.length() + " characters.");
} else if (sourceFile != null && sourceFile.length() > 0) {
java.io.File f = new java.io.File(sourceFile);
if (!f.exists()) {
log.error("File " + f.getAbsolutePath() + " does not exist! Will not create VFS file: " + file);
return;
}
if (!f.isFile()) {
log.error("Path " + f.getAbsolutePath() + " is not a file! Will not create VFS file: " + file);
return;
}
cmd = "cat > " + file + " &< " + f.getAbsolutePath();
log.debug(cmd);
if (shell != null) {
shell.execute(cmd);
} else {
rshell.execute(cmd);
}
log.log(NOTICE, "Created file " + file + ", wrote " + f.length() + " bytes.");
} else if (url != null) {
InputStream is = null;
try {
java.net.URLConnection uc = url.openConnection();
uc.setConnectTimeout(30 * 1000);
uc.setReadTimeout(60 * 1000);
is = uc.getInputStream();
ProcessInfo pinf = null;
cmd = "cat > " + file;
log.debug(cmd);
if (shell != null) {
pinf = shell.execute(cmd);
sos = new ShellOutputStream(shell, pinf.procid);