Examples of PartStore


Examples of org.docx4j.openpackaging.io3.stores.PartStore

      log.warn("No package owns this part, and/or you didn't set its contents.");
      return null;       
    }
   
    // no cached buffer, try to load part data now     
    PartStore partStore = this.getPackage().getSourcePartStore();
    if (partStore==null) {
      log.warn("No PartStore configured for this package");
      return null;
    }
   
   
    InputStream is=null;
    try {
      String name = this.getPartName().getName();
     
      try {
        this.setContentLengthAsLoaded(
            partStore.getPartSize( name.substring(1)));
      } catch (UnsupportedOperationException uoe) {}
     
      is = partStore.loadPart( name.substring(1));
      if (is==null) {
        log.warn(name + " missing from part store");
      } else {
       
//        if (log.isDebugEnabled()) {
View Full Code Here

Examples of org.docx4j.openpackaging.io3.stores.PartStore

    if (jaxbElement==null) {
      if (this.getPackage()==null) {
        log.warn("This part not added to a package, so its contents can't be retrieved. " );
        return null;
      }
      PartStore partStore = this.getPackage().getSourcePartStore();
      if (partStore==null) {
        log.warn("No PartStore defined for this package (it was probably created, not loaded). " );
        log.warn(this.getPartName().getName() + ": did you initialise its contents to something?");
        return null;
        // or we could create it, with a bit of effort;
        // as to which see http://stackoverflow.com/questions/1090458/instantiating-a-generic-class-in-java
      }      
     
      try {
        String name = this.getPartName().getName();
       
        try {
          if (partStore!=null) {
            this.setContentLengthAsLoaded(
                partStore.getPartSize( name.substring(1)));
          }
        } catch (UnsupportedOperationException uoe) {}
         
        is = partStore.loadPart(
            name.substring(1));
        if (is==null) {
          log.warn(name + " missing from part store");
        } else {
          log.info("Lazily unmarshalling " + name);
View Full Code Here

Examples of org.docx4j.openpackaging.io3.stores.PartStore

   
    // Get the contents as a string
    String wmlTemplateString = null;
    if (jaxbElement==null) {

      PartStore partStore = this.getPackage().getSourcePartStore();
      String name = this.getPartName().getName();
      InputStream is = partStore.loadPart(
          name.substring(1));
      if (is==null) {
        log.warn(name + " missing from part store");
        throw new Docx4JException(name + " missing from part store");
      } else {
View Full Code Here

Examples of org.docx4j.openpackaging.io3.stores.PartStore

    if (jaxbElement == null) {
      // Test jaxbElement, since we don't want to do the
      // below if jaxbElement has already been set
      // using setJaxbElement (which doesn't create
      // binder)
      PartStore partStore = this.getPackage().getSourcePartStore();
     
      InputStream is = null;
      try {
        String name = this.getPartName().getName();
       
        try {
          this.setContentLengthAsLoaded(
              partStore.getPartSize( name.substring(1)));
        } catch (UnsupportedOperationException uoe) {}
       
        is = partStore.loadPart(
            name.substring(1));
        if (is==null) {
          log.warn(name + " missing from part store");
        } else {
          log.info("Lazily unmarshalling " + name);
View Full Code Here

Examples of org.docx4j.openpackaging.io3.stores.PartStore

 
  public Save(OpcPackage p) {
   
    this.p = p;
//    sourcePartStore = p.getSourcePartStore();
    PartStore targetPartStore;
    if (p.getSourcePartStore()==null) // eg a newly created package
    {
      log.warn("sourcePartStore undefined");
      targetPartStore = new ZipPartStore();
    } else {
      targetPartStore = p.getSourcePartStore();
      targetPartStore.setSourcePartStore(p.getSourcePartStore());
    }
    p.setTargetPartStore(targetPartStore);
   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.