throws IOException {
FileOutputStream fos = null;
File tmpOutput = new File(output.getParent(), "tmp" + output.getName());
try {
ExecuteResponseType response = responseBuilder.build();
XmlObjectEncodingResponse encoder = new XmlObjectEncodingResponse(
ExecuteResponseType.class, "ExecuteResponse", WPSConfiguration.class);
fos = new FileOutputStream(tmpOutput);
encoder.write(response, fos, null);
fos.flush();
fos.close();
if (!tmpOutput.renameTo(output)) {
LOGGER.log(Level.SEVERE, "Failed to rename " + tmpOutput + " to " + output);
} else {