public void saveCustomXmlDataStoragePart(CustomXmlDataStoragePart part) throws Docx4JException { String targetName = part.getPartName().getName().substring(1); String filePath = dir.getPath() + dir.separator + targetName; File file = new File(filePath); file.getParentFile().mkdirs(); try { FileOutputStream fos = new FileOutputStream(file); part.getData().writeDocument( fos ); fos.close(); } catch (Exception e) { throw new Docx4JException("Error marshalling CustomXmlDataStoragePart " + part.getPartName(), e); } }
public void saveCustomXmlDataStoragePart(CustomXmlDataStoragePart part) throws Docx4JException { String targetName = part.getPartName().getName().substring(1); try { // Add ZIP entry to output stream. zos.putArchiveEntry(new ZipArchiveEntry(targetName)); part.getData().writeDocument( zos ); // Complete the entry zos.closeArchiveEntry(); } catch (Exception e) { throw new Docx4JException("Error marshalling CustomXmlDataStoragePart " + part.getPartName(), e); } }
public void saveCustomXmlDataStoragePart(CustomXmlDataStoragePart part) throws Docx4JException { String targetName = part.getPartName().getName().substring(1); String filePath = dir.getPath() + dir.separator + targetName; File file = new File(filePath); file.getParentFile().mkdirs(); try { FileOutputStream fos = new FileOutputStream(file); part.getData().writeDocument( fos ); fos.close(); } catch (Exception e) { throw new Docx4JException("Error marshalling CustomXmlDataStoragePart " + part.getPartName(), e); } }
public void saveCustomXmlDataStoragePart(CustomXmlDataStoragePart part) throws Docx4JException { String targetName = part.getPartName().getName().substring(1); try { // Add ZIP entry to output stream. zos.putArchiveEntry(new ZipArchiveEntry(targetName)); part.getData().writeDocument( zos ); // Complete the entry zos.closeArchiveEntry(); } catch (Exception e) { throw new Docx4JException("Error marshalling CustomXmlDataStoragePart " + part.getPartName(), e); } }