Package org.apache.poi.openxml4j.exceptions

Examples of org.apache.poi.openxml4j.exceptions.OpenXML4JException


                .getPartName().getName()) + "'");
        PartMarshaller marshaller = partMarshallers
            .get(part.contentType);
        if (marshaller != null) {
          if (!marshaller.marshall(part, zos)) {
            throw new OpenXML4JException(
                "The part "
                    + part.getPartName().getURI()
                    + " fail to be saved in the stream with marshaller "
                    + marshaller);
          }
        } else {
          if (!defaultPartMarshaller.marshall(part, zos))
            throw new OpenXML4JException(
                "The part "
                    + part.getPartName().getURI()
                    + " fail to be saved in the stream with marshaller "
                    + defaultPartMarshaller);
        }
View Full Code Here


   */
  public boolean marshall(PackagePart part, OutputStream os)
      throws OpenXML4JException {
    if (!(os instanceof ZipOutputStream)) {
      logger.log(POILogger.ERROR,"Unexpected class " + os.getClass().getName());
      throw new OpenXML4JException("ZipOutputStream expected !");
      // Normally should happen only in developement phase, so just throw
      // exception
    }

    ZipOutputStream zos = (ZipOutputStream) os;
View Full Code Here

                .getPartName().getName()) + "'");
        PartMarshaller marshaller = partMarshallers
            .get(part._contentType);
        if (marshaller != null) {
          if (!marshaller.marshall(part, zos)) {
            throw new OpenXML4JException(
                "The part "
                    + part.getPartName().getURI()
                    + " fail to be saved in the stream with marshaller "
                    + marshaller);
          }
        } else {
          if (!defaultPartMarshaller.marshall(part, zos))
            throw new OpenXML4JException(
                "The part "
                    + part.getPartName().getURI()
                    + " fail to be saved in the stream with marshaller "
                    + defaultPartMarshaller);
        }
View Full Code Here

   */
  public boolean marshall(PackagePart part, OutputStream os)
      throws OpenXML4JException {
    if (!(os instanceof ZipOutputStream)) {
      logger.error("Unexpected class " + os.getClass().getName());
      throw new OpenXML4JException("ZipOutputStream expected !");
      // Normally should happen only in developpement phase, so just throw
      // exception
    }

    ZipOutputStream zos = (ZipOutputStream) os;
View Full Code Here

                .getPartName().getName()) + "'");
        PartMarshaller marshaller = partMarshallers
            .get(part._contentType);
        if (marshaller != null) {
          if (!marshaller.marshall(part, zos)) {
            throw new OpenXML4JException(
                "The part "
                    + part.getPartName().getURI()
                    + " fail to be saved in the stream with marshaller "
                    + marshaller);
          }
        } else {
          if (!defaultPartMarshaller.marshall(part, zos))
            throw new OpenXML4JException(
                "The part "
                    + part.getPartName().getURI()
                    + " fail to be saved in the stream with marshaller "
                    + defaultPartMarshaller);
        }
View Full Code Here

                .getPartName().getName()) + "'");
        PartMarshaller marshaller = partMarshallers
            .get(part._contentType);
        if (marshaller != null) {
          if (!marshaller.marshall(part, zos)) {
            throw new OpenXML4JException(
                "The part "
                    + part.getPartName().getURI()
                    + " fail to be saved in the stream with marshaller "
                    + marshaller);
          }
        } else {
          if (!defaultPartMarshaller.marshall(part, zos))
            throw new OpenXML4JException(
                "The part "
                    + part.getPartName().getURI()
                    + " fail to be saved in the stream with marshaller "
                    + defaultPartMarshaller);
        }
View Full Code Here

   */
  public boolean marshall(PackagePart part, OutputStream os)
      throws OpenXML4JException {
    if (!(os instanceof ZipOutputStream)) {
      logger.log(POILogger.ERROR,"Unexpected class " + os.getClass().getName());
      throw new OpenXML4JException("ZipOutputStream expected !");
      // Normally should happen only in developement phase, so just throw
      // exception
    }

    ZipOutputStream zos = (ZipOutputStream) os;
View Full Code Here

                .getPartName().getName()) + "'");
        PartMarshaller marshaller = partMarshallers
            .get(part._contentType);
        if (marshaller != null) {
          if (!marshaller.marshall(part, zos)) {
            throw new OpenXML4JException(
                "The part "
                    + part.getPartName().getURI()
                    + " fail to be saved in the stream with marshaller "
                    + marshaller);
          }
        } else {
          if (!defaultPartMarshaller.marshall(part, zos))
            throw new OpenXML4JException(
                "The part "
                    + part.getPartName().getURI()
                    + " fail to be saved in the stream with marshaller "
                    + defaultPartMarshaller);
        }
View Full Code Here

                .getPartName().getName()) + "'");
        PartMarshaller marshaller = partMarshallers
            .get(part.contentType);
        if (marshaller != null) {
          if (!marshaller.marshall(part, zos)) {
            throw new OpenXML4JException(
                "The part "
                    + part.getPartName().getURI()
                    + " fail to be saved in the stream with marshaller "
                    + marshaller);
          }
        } else {
          if (!defaultPartMarshaller.marshall(part, zos))
            throw new OpenXML4JException(
                "The part "
                    + part.getPartName().getURI()
                    + " fail to be saved in the stream with marshaller "
                    + defaultPartMarshaller);
        }
View Full Code Here

      if (!StreamHelper.saveXmlInStream(xmlDoc, out)) {
        return false;
      }
      zos.closeEntry();
    } catch (IOException e) {
      throw new OpenXML4JException(e.getLocalizedMessage());
    }
    return true;
  }
View Full Code Here

TOP

Related Classes of org.apache.poi.openxml4j.exceptions.OpenXML4JException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.