BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(planFile));
projectExport.exportComplete(plan.getPlanProperties().getId(), out, binarydataTempPath);
out.flush();
out.close();
planManagement.deployPlan(planIdentifier, new FileInputStream(planFile));
} catch (Exception e) {
throw new PlanningException("Failed to generate plan.", e);
}
} finally {
OS.deleteDirectory(binarydataTempDir);