Package org.apache.poi.poifs.filesystem

Examples of org.apache.poi.poifs.filesystem.DocumentInputStream


      while (entries.hasNext()) {
        copyNodeRecursively((Entry)entries.next(),newTarget);
      }
    } else {
      DocumentEntry dentry = (DocumentEntry)entry;
      DocumentInputStream dstream = new DocumentInputStream(dentry);
      target.createDocument(dentry.getName(),dstream);
      dstream.close();
    }
  }
View Full Code Here


            throws IOException, TikaException {
        try {
            DocumentEntry entry =
                (DocumentEntry) filesystem.getRoot().getEntry(entryName);
            PropertySet properties =
                new PropertySet(new DocumentInputStream(entry));
            if (properties.isSummaryInformation()) {
                parse(new SummaryInformation(properties), metadata);
            }
            if (properties.isDocumentSummaryInformation()) {
                parse(new DocumentSummaryInformation(properties), metadata);
View Full Code Here

            hssfRequest.addListener(listener, HyperlinkRecord.sid);
            hssfRequest.addListener(listener, TextObjectRecord.sid);
        }

        // Create event factory and process Workbook (fire events)
        DocumentInputStream documentInputStream = filesystem.createDocumentInputStream("Workbook");
        HSSFEventFactory eventFactory = new HSSFEventFactory();

        eventFactory.processEvents(hssfRequest, documentInputStream);
        listener.throwStoredException();
    }
View Full Code Here

   */
  protected PropertySet getPropertySet(String setName) {
     //directory can be null when creating new documents
     if(directory == null) return null;

     DocumentInputStream dis;
     try {
        // Find the entry, and get an input stream for it
        dis = directory.createDocumentInputStream( directory.getEntry(setName) );
     } catch(IOException ie) {
        // Oh well, doesn't exist
View Full Code Here

         }
        
         if(chunk != null) {
             if(entry instanceof DocumentNode) {
                try {
                   DocumentInputStream inp = new DocumentInputStream((DocumentNode)entry);
                   chunk.readValue(inp);
                   grouping.record(chunk);
                } catch(IOException e) {
                   System.err.println("Error reading from part " + entry.getName() + " - " + e.toString());
                }
View Full Code Here

    byte[] pictstream;

    try {
      DocumentEntry entry = (DocumentEntry)directory.getEntry("Pictures");
      pictstream = new byte[entry.getSize()];
      DocumentInputStream is = directory.createDocumentInputStream("Pictures");
      is.read(pictstream);
    } catch (FileNotFoundException e){
      // Silently catch exceptions if the presentation doesn't
      //  contain pictures - will use a null set instead
      return;
    }
View Full Code Here

               IOException, UnsupportedEncodingException
    {
        InputStream inp = null;
        try {
            DocumentEntry entry = (DocumentEntry)dir.getEntry(name);
            inp = new DocumentInputStream(entry);
            try {
                return create(inp);
            } catch (MarkUnsupportedException e) { return null; }
        } finally {
            if (inp != null) inp.close();
View Full Code Here

        fis.close();

        //read the document entry from OLE file system
        DocumentEntry entry = (DocumentEntry)fs.getRoot().getEntry(PPDOC_ENTRY);
        docstream = new byte[entry.getSize()];
        DocumentInputStream is = fs.createDocumentInputStream(PPDOC_ENTRY);
        is.read(docstream);

        try {
            entry = (DocumentEntry)fs.getRoot().getEntry(PICTURES_ENTRY);
            pictstream = new byte[entry.getSize()];
            is = fs.createDocumentInputStream(PICTURES_ENTRY);
            is.read(pictstream);
        } catch(FileNotFoundException e){
            //silently catch errors if the presentation does not contain pictures
        }
    }
View Full Code Here

        assert(cm == ChainingMode.ecb);
        return CryptoFunctions.getCipher(key, em.getCipherAlgorithm(), cm, null, Cipher.DECRYPT_MODE);
    }

    public InputStream getDataStream(DirectoryNode dir) throws IOException {
        DocumentInputStream dis = dir.createDocumentInputStream("EncryptedPackage");

        _length = dis.readLong();

        return new BoundedInputStream(new CipherInputStream(dis, getCipher(getSecretKey())), _length);
    }
View Full Code Here

    protected PropertySet getPropertySet(String setName) {
        //directory can be null when creating new documents
        if (directory == null || !directory.hasEntry(setName))
            return null;

        DocumentInputStream dis;
        try {
            // Find the entry, and get an input stream for it
            dis = directory.createDocumentInputStream( directory.getEntry(setName) );
        } catch(IOException ie) {
            // Oh well, doesn't exist
View Full Code Here

TOP

Related Classes of org.apache.poi.poifs.filesystem.DocumentInputStream

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.