Package org.apache.poi.hpsf

Examples of org.apache.poi.hpsf.PropertySet


     * @exception HPSFException if an HPSF operation fails
     */
    public void testPropertySetMethods() throws IOException, HPSFException
    {
        byte[] b = poiFiles[1].getBytes();
        PropertySet ps =
            PropertySetFactory.create(new ByteArrayInputStream(b));
        SummaryInformation s = (SummaryInformation) ps;
        assertNull(s.getTitle());
        assertNull(s.getSubject());
        assertNotNull(s.getAuthor());
View Full Code Here


   *  Documment Information Properties (HPSF).
   * If a given property set is missing or corrupt,
   *  it will remain null;
   */
  protected void readProperties() {
    PropertySet ps;
   
    // DocumentSummaryInformation
    ps = getPropertySet(DocumentSummaryInformation.DEFAULT_STREAM_NAME);
    if(ps != null && ps instanceof DocumentSummaryInformation) {
      dsInf = (DocumentSummaryInformation)ps;
    } else if(ps != null) {
      logger.log(POILogger.WARN, "DocumentSummaryInformation property set came back with wrong class - ", ps.getClass());
    }

    // SummaryInformation
    ps = getPropertySet(SummaryInformation.DEFAULT_STREAM_NAME);
    if(ps instanceof SummaryInformation) {
      sInf = (SummaryInformation)ps;
    } else if(ps != null) {
      logger.log(POILogger.WARN, "SummaryInformation property set came back with wrong class - ", ps.getClass());
    }

    // Mark the fact that we've now loaded up the properties
        initialized = true;
  }
View Full Code Here

        return null;
     }

     try {
        // Create the Property Set
        PropertySet set = PropertySetFactory.create(dis);
        return set;
     } catch(IOException ie) {
        // Must be corrupt or something like that
        logger.log(POILogger.WARN, "Error creating property set with name " + setName + "\n" + ie);
     } catch(org.apache.poi.hpsf.HPSFException he) {
View Full Code Here

            POIFSFileSystem filesystem, String entryName, Metadata metadata)
            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);
            }
        } catch (FileNotFoundException e) {
            // entry does not exist, just skip it
        } catch (NoPropertySetStreamException e) {
View Full Code Here

   *  Documment Information Properties (HPSF).
   * If a given property set is missing or corrupt,
   *  it will remain null;
   */
  protected void readProperties() {
    PropertySet ps;
   
    // DocumentSummaryInformation
    ps = getPropertySet(DocumentSummaryInformation.DEFAULT_STREAM_NAME);
    if(ps != null && ps instanceof DocumentSummaryInformation) {
      dsInf = (DocumentSummaryInformation)ps;
    } else if(ps != null) {
      logger.log(POILogger.WARN, "DocumentSummaryInformation property set came back with wrong class - ", ps.getClass());
    }

    // SummaryInformation
    ps = getPropertySet(SummaryInformation.DEFAULT_STREAM_NAME);
    if(ps instanceof SummaryInformation) {
      sInf = (SummaryInformation)ps;
    } else if(ps != null) {
      logger.log(POILogger.WARN, "SummaryInformation property set came back with wrong class - ", ps.getClass());
    }

    // Mark the fact that we've now loaded up the properties
        initialized = true;
  }
View Full Code Here

        return null;
     }

     try {
        // Create the Property Set
        PropertySet set = PropertySetFactory.create(dis);
        return set;
     } catch(IOException ie) {
        // Must be corrupt or something like that
        logger.log(POILogger.WARN, "Error creating property set with name " + setName + "\n" + ie);
     } catch(org.apache.poi.hpsf.HPSFException he) {
View Full Code Here

         // Check we can read it
         assertContentsMatches(null, doc);
        
         // Now try to build the property set
         DocumentInputStream inp = new NDocumentInputStream(doc);
         PropertySet ps = PropertySetFactory.create(inp);
         SummaryInformation inf = (SummaryInformation)ps;
        
         // Check some bits in it
         assertEquals(null, inf.getApplicationName());
         assertEquals(null, inf.getAuthor());
View Full Code Here

     *  Document Information Properties (HPSF).
     * If a given property set is missing or corrupt,
     *  it will remain null;
     */
    protected void readProperties() {
        PropertySet ps;

        // DocumentSummaryInformation
        ps = getPropertySet(DocumentSummaryInformation.DEFAULT_STREAM_NAME);
        if (ps != null && ps instanceof DocumentSummaryInformation) {
            dsInf = (DocumentSummaryInformation)ps;
        } else if(ps != null) {
            logger.log(POILogger.WARN, "DocumentSummaryInformation property set came back with wrong class - ", ps.getClass());
        }

        // SummaryInformation
        ps = getPropertySet(SummaryInformation.DEFAULT_STREAM_NAME);
        if (ps instanceof SummaryInformation) {
            sInf = (SummaryInformation)ps;
        } else if(ps != null) {
            logger.log(POILogger.WARN, "SummaryInformation property set came back with wrong class - ", ps.getClass());
        }

        // Mark the fact that we've now loaded up the properties
        initialized = true;
    }
View Full Code Here

            return null;
        }

        try {
            // Create the Property Set
            PropertySet set = PropertySetFactory.create(dis);
            return set;
        } catch(IOException ie) {
            // Must be corrupt or something like that
            logger.log(POILogger.WARN, "Error creating property set with name " + setName + "\n" + ie);
        } catch(org.apache.poi.hpsf.HPSFException he) {
View Full Code Here

            POIFSFileSystem filesystem, String entryName)
            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));
            }
            if (properties.isDocumentSummaryInformation()) {
                parse(new DocumentSummaryInformation(properties));
            }
        } catch (FileNotFoundException e) {
            // entry does not exist, just skip it
        } catch (NoPropertySetStreamException e) {
View Full Code Here

TOP

Related Classes of org.apache.poi.hpsf.PropertySet

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.