try {
out = new FileOutputStream(destination);
output.output(document, out);
out.close();
} catch (FileNotFoundException e) {
throw new InterpreterException(Activator.getDefault().createErrorStatus(e.getMessage(), e));
} catch (IOException e) {
throw new InterpreterException(Activator.getDefault().createErrorStatus(e.getMessage(), e));
} finally {
if (out != null) {
try {
out.close();
} catch (IOException e) {
throw new InterpreterException(Activator.getDefault().createErrorStatus(e.getMessage(), e));
}
}
}
}