static void writePatch ( final Patch rollbackPatch , final File file ) throws IOException { final File parent = file . getParentFile ( ) ; if ( ! parent . isDirectory ( ) ) { if ( ! parent . mkdirs ( ) && ! parent . exists ( ) ) { throw PatchLogger . ROOT_LOGGER . cannotCreateDirectory ( file . getAbsolutePath ( ) ) ; } } try { try ( final OutputStream os = new FileOutputStream ( file ) ) { PatchXml . marshal ( os , rollbackPatch ) ; } } catch ( XMLStreamException e ) { throw new IOException ( e ) ; } }
Write the patch . xml