OutputStream out = process.getOutputStream();
out.write(content);
out.close();
HttpInputStream in = new HttpInputStream(process.getInputStream());
HttpInputStream err = new HttpInputStream(process.getErrorStream());
ByteArrayOutputStream inB = new ByteArrayOutputStream();
in.copyTo(inB);
if (inB.size() > 0) {
content=inB.toByteArray();
String newType = request.props.getProperty(prefix + "newType");
if (newType != null) {
newType = Format.subst(request.props, newType);
request.log(Server.LOG_DIAGNOSTIC, prefix +
"Changing content type to: " + newType);
headers.put("content-type", newType);
}
} else {
request.log(Server.LOG_DIAGNOSTIC, prefix +
"No content from filter");
}
in.close();
inB.close();
ByteArrayOutputStream errB = new ByteArrayOutputStream();
err.copyTo(errB);
if (errB.size() > 0) {
request.log(Server.LOG_DIAGNOSTIC, prefix +
"Error result: " + errB);
request.props.put(prefix + "error", errB.toString());
}
err.close();
errB.close();
process.waitFor();
} catch (Exception e) {
request.log(Server.LOG_DIAGNOSTIC, prefix +