You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by kl...@apache.org on 2003/09/01 20:49:52 UTC

cvs commit: jakarta-poi/src/examples/src/org/apache/poi/hpsf/examples ReadCustomPropertySets.java ReadTitle.java

klute       2003/09/01 11:49:52

  Modified:    src/examples/src/org/apache/poi/hpsf/examples
                        ReadCustomPropertySets.java ReadTitle.java
  Log:
  
  
  Revision  Changes    Path
  1.2       +24 -9     jakarta-poi/src/examples/src/org/apache/poi/hpsf/examples/ReadCustomPropertySets.java
  
  Index: ReadCustomPropertySets.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/examples/src/org/apache/poi/hpsf/examples/ReadCustomPropertySets.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReadCustomPropertySets.java	2 Feb 2003 05:54:09 -0000	1.1
  +++ ReadCustomPropertySets.java	1 Sep 2003 18:49:52 -0000	1.2
  @@ -54,10 +54,19 @@
    */
   package org.apache.poi.hpsf.examples;
   
  -import java.io.*;
  -import java.util.*;
  -import org.apache.poi.hpsf.*;
  -import org.apache.poi.poifs.eventfilesystem.*;
  +import java.io.FileInputStream;
  +import java.io.IOException;
  +import java.util.Iterator;
  +import java.util.List;
  +
  +import org.apache.poi.hpsf.NoPropertySetStreamException;
  +import org.apache.poi.hpsf.Property;
  +import org.apache.poi.hpsf.PropertySet;
  +import org.apache.poi.hpsf.PropertySetFactory;
  +import org.apache.poi.hpsf.Section;
  +import org.apache.poi.poifs.eventfilesystem.POIFSReader;
  +import org.apache.poi.poifs.eventfilesystem.POIFSReaderEvent;
  +import org.apache.poi.poifs.eventfilesystem.POIFSReaderListener;
   import org.apache.poi.util.HexDump;
   
   /**
  @@ -74,7 +83,13 @@
   public class ReadCustomPropertySets
   {
   
  -    public static void main(String[] args)
  +    /**
  +     * <p>Runs the example program.</p>
  +     *
  +     * @param args Command-line arguments (unused).
  +     * @throws IOException if any I/O exception occurs.
  +     */
  +    public static void main(final String[] args)
           throws IOException
       {
           final String filename = args[0];
  @@ -88,7 +103,7 @@
   
       static class MyPOIFSReaderListener implements POIFSReaderListener
       {
  -        public void processPOIFSReaderEvent(POIFSReaderEvent event)
  +        public void processPOIFSReaderEvent(final POIFSReaderEvent event)
           {
               PropertySet ps = null;
               try
  @@ -138,7 +153,7 @@
                   {
                       /* Print a single property: */
                       Property p = properties[i2];
  -                    int id = p.getID();
  +                    long id = p.getID();
                       long type = p.getType();
                       Object value = p.getValue();
                       out("      Property ID: " + id + ", type: " + type +
  @@ -153,7 +168,7 @@
           System.out.println(msg);
       }
   
  -    static String hex(byte[] bytes)
  +    static String hex(final byte[] bytes)
       {
           return HexDump.dump(bytes, 0L, 0);
       }
  
  
  
  1.3       +18 -7     jakarta-poi/src/examples/src/org/apache/poi/hpsf/examples/ReadTitle.java
  
  Index: ReadTitle.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/examples/src/org/apache/poi/hpsf/examples/ReadTitle.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ReadTitle.java	20 Feb 2003 17:51:37 -0000	1.2
  +++ ReadTitle.java	1 Sep 2003 18:49:52 -0000	1.3
  @@ -54,9 +54,14 @@
    */
   package org.apache.poi.hpsf.examples;
   
  -import java.io.*;
  -import org.apache.poi.hpsf.*;
  -import org.apache.poi.poifs.eventfilesystem.*;
  +import java.io.FileInputStream;
  +import java.io.IOException;
  +
  +import org.apache.poi.hpsf.PropertySetFactory;
  +import org.apache.poi.hpsf.SummaryInformation;
  +import org.apache.poi.poifs.eventfilesystem.POIFSReader;
  +import org.apache.poi.poifs.eventfilesystem.POIFSReaderEvent;
  +import org.apache.poi.poifs.eventfilesystem.POIFSReaderListener;
   
   /**
    * <p>Sample application showing how to read a OLE 2 document's
  @@ -71,8 +76,14 @@
    */
   public class ReadTitle
   {
  -
  -    public static void main(String[] args) throws IOException
  +    /**
  +     * <p>Runs the example program.</p>
  +     *
  +     * @param args Command-line arguments. The first command-line argument must
  +     * be the name of a POI filesystem to read.
  +     * @throws IOException if any I/O exception occurs.
  +     */
  +    public static void main(final String[] args) throws IOException
       {
           final String filename = args[0];
           POIFSReader r = new POIFSReader();
  @@ -84,7 +95,7 @@
   
       static class MyPOIFSReaderListener implements POIFSReaderListener
       {
  -        public void processPOIFSReaderEvent(POIFSReaderEvent event)
  +        public void processPOIFSReaderEvent(final POIFSReaderEvent event)
           {
               SummaryInformation si = null;
               try
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-dev-help@jakarta.apache.org