@Override public boolean marshall(PackagePart part, OutputStream out) throws OpenXML4JException { if (!(out instanceof ZipArchiveOutputStream)) { throw new IllegalArgumentException("ZipOutputStream expected!"); } ZipArchiveOutputStream zos = (ZipArchiveOutputStream) out; // Saving the part in the zip file ZipArchiveEntry ctEntry = new ZipArchiveEntry(ZipHelper .getZipItemNameFromOPCName(part.getPartName().getURI() .toString())); try { // Save in ZIP zos.putArchiveEntry(ctEntry); // Add entry in ZIP try { super.marshall(part, out); // Marshall the properties inside a XML // Document return StreamHelper.saveXmlInStream(xmlDoc, out); } finally { zos.closeArchiveEntry(); } } catch (IOException e) { throw new OpenXML4JException(e.getLocalizedMessage(), e); } } }
throw new IOException(xe.getMessage()); } catch(OpenXML4JException oe) { throw new IOException(oe.getMessage());
if (!(os instanceof ZipArchiveOutputStream)) { logger.log(POILogger.ERROR,"Unexpected class " + os.getClass().getName()); throw new OpenXML4JException("ZipOutputStream expected !");
if (!pm.marshall(part, zos)) { String errMsg = "The part " + ppn.getURI() + " failed to be saved in the stream with marshaller "; throw new OpenXML4JException(errMsg + pm);
@Override public boolean marshall(PackagePart part, OutputStream out) throws OpenXML4JException { if (!(out instanceof ZipOutputStream)) { throw new IllegalArgumentException("ZipOutputStream expected!"); } ZipOutputStream zos = (ZipOutputStream) out; // Saving the part in the zip file ZipEntry ctEntry = new ZipEntry(ZipHelper .getZipItemNameFromOPCName(part.getPartName().getURI() .toString())); try { // Save in ZIP zos.putNextEntry(ctEntry); // Add entry in ZIP super.marshall(part, out); // Marshall the properties inside a XML // Document if (!StreamHelper.saveXmlInStream(xmlDoc, out)) { return false; } zos.closeEntry(); } catch (IOException e) { throw new OpenXML4JException(e.getLocalizedMessage()); } return true; } }
if (!(os instanceof ZipOutputStream)) { logger.log(POILogger.ERROR,"Unexpected class " + os.getClass().getName()); throw new OpenXML4JException("ZipOutputStream expected !");
@Override public boolean marshall(PackagePart part, OutputStream out) throws OpenXML4JException { if (!(out instanceof ZipArchiveOutputStream)) { throw new IllegalArgumentException("ZipOutputStream expected!"); } ZipArchiveOutputStream zos = (ZipArchiveOutputStream) out; // Saving the part in the zip file ZipArchiveEntry ctEntry = new ZipArchiveEntry(ZipHelper .getZipItemNameFromOPCName(part.getPartName().getURI() .toString())); try { // Save in ZIP zos.putArchiveEntry(ctEntry); // Add entry in ZIP try { super.marshall(part, out); // Marshall the properties inside a XML // Document return StreamHelper.saveXmlInStream(xmlDoc, out); } finally { zos.closeArchiveEntry(); } } catch (IOException e) { throw new OpenXML4JException(e.getLocalizedMessage(), e); } } }
if (!(os instanceof ZipArchiveOutputStream)) { logger.log(POILogger.ERROR,"Unexpected class " + os.getClass().getName()); throw new OpenXML4JException("ZipOutputStream expected !");
if (marshaller != null) { if (!marshaller.marshall(part, zos)) { throw new OpenXML4JException( "The part " + part.getPartName().getURI() throw new OpenXML4JException( "The part " + part.getPartName().getURI()
if (!pm.marshall(part, zos)) { String errMsg = "The part " + ppn.getURI() + " failed to be saved in the stream with marshaller "; throw new OpenXML4JException(errMsg + pm);