Package org.docx4j.openpackaging.exceptions

Examples of org.docx4j.openpackaging.exceptions.Docx4JException


      n.appendChild(t);     
     
      // cache is now invalid
      return true;
    } catch (Exception e) {
      throw new Docx4JException("Problem setting value at xpath " + xpath);
    }
   
  }
View Full Code Here


    try {
      if (filepath.toLowerCase().endsWith(".xml") ) {
        return saveFlatOPC(new FileOutputStream(filepath));
      } else return save(new FileOutputStream(filepath));
    } catch (FileNotFoundException e) {
      throw new Docx4JException("Failed to save package to path " + filepath, e);
    }
  }
View Full Code Here

    try {
      if (docxFile.getPath().toLowerCase().endsWith(".xml") ) {
        return saveFlatOPC(new FileOutputStream(docxFile));
      } else return save(new FileOutputStream(docxFile));
    } catch (FileNotFoundException e) {
      throw new Docx4JException("Failed to save package to path " + docxFile.getPath(), e);
    }
  }
View Full Code Here

          NamespacePrefixMapperUtils.getPrefixMapper());     
     
      marshaller.marshal(pkg, realOS);
      return true;
    } catch (Exception e) {
      throw new Docx4JException("Failed to save Flat OPC ", e);
    }      
   
  }
View Full Code Here

            sb.append(".. DELETED" );
          }
        }       
         
      } catch (Exception e) {
        throw new Docx4JException("Failed to add parts from relationships", e);       
      }
           
    }
   
    for ( Relationship r : deletions) {
View Full Code Here

      } catch (Exception e) {
      e.printStackTrace() ;
      if (e instanceof Docx4JException) {
        throw (Docx4JException)e;
      } else {
        throw new Docx4JException("Failed to save package", e);
      }
      }

      log.info("...Done!" );   
View Full Code Here

      }   
   
    } catch (Exception e) {
      e.printStackTrace();
      log.error(e.getMessage(), e);
      throw new Docx4JException("Problem saving part " + zipEntryName, e);
    }
   
  }
View Full Code Here

          savePart(out, part);
         
        }
         
      } catch (Exception e) {
        throw new Docx4JException("Failed to add parts from relationships of " + rp.getSourceP().getPartName(), e);       
      }
    }
   
   
  }
View Full Code Here

      // Complete the entry
          out.closeEntry();
     
    } catch (Exception e ) {
      throw new Docx4JException("Failed to put binary part", e);     
    }
   
    log.info( "success writing part: " + resolvedPartUri);   
   
  }
View Full Code Here

         
      }
    } catch (Exception ex) {
      // PathNotFoundException, ValueFormatException, RepositoryException, URISyntaxException
      ex.printStackTrace();
      throw new Docx4JException("Failed to getPart", ex);
    }
    return part;
  }
View Full Code Here

TOP

Related Classes of org.docx4j.openpackaging.exceptions.Docx4JException

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.