klute       2003/02/20 09:51:37

  Modified:    src/examples/src/org/apache/poi/hpsf/examples ReadTitle.java
  Log:
  
  
  Revision  Changes    Path
  1.2       +26 -26    
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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReadTitle.java    1 Feb 2003 13:30:55 -0000       1.1
  +++ ReadTitle.java    20 Feb 2003 17:51:37 -0000      1.2
  @@ -74,36 +74,36 @@
   
       public static void main(String[] args) throws IOException
       {
  -     final String filename = args[0];
  -     POIFSReader r = new POIFSReader();
  -     r.registerListener(new MyPOIFSReaderListener(),
  -                        "\005SummaryInformation");
  -     r.read(new FileInputStream(filename));
  +        final String filename = args[0];
  +        POIFSReader r = new POIFSReader();
  +        r.registerListener(new MyPOIFSReaderListener(),
  +                           "\005SummaryInformation");
  +        r.read(new FileInputStream(filename));
       }
   
   
       static class MyPOIFSReaderListener implements POIFSReaderListener
       {
  -     public void processPOIFSReaderEvent(POIFSReaderEvent event)
  -     {
  -         SummaryInformation si = null;
  -         try
  -         {
  -             si = (SummaryInformation)
  -                 PropertySetFactory.create(event.getStream());
  -         }
  -         catch (Exception ex)
  -         {
  -             throw new RuntimeException
  -                 ("Property set stream \"" +
  -                  event.getPath() + event.getName() + "\": " + ex);
  -         }
  -         final String title = si.getTitle();
  -         if (title != null)
  -             System.out.println("Title: \"" + title + "\"");
  -         else
  -             System.out.println("Document has no title.");
  -     }
  +        public void processPOIFSReaderEvent(POIFSReaderEvent event)
  +        {
  +            SummaryInformation si = null;
  +            try
  +            {
  +                si = (SummaryInformation)
  +                    PropertySetFactory.create(event.getStream());
  +            }
  +            catch (Exception ex)
  +            {
  +                throw new RuntimeException
  +                    ("Property set stream \"" +
  +                     event.getPath() + event.getName() + "\": " + ex);
  +            }
  +            final String title = si.getTitle();
  +            if (title != null)
  +                System.out.println("Title: \"" + title + "\"");
  +            else
  +                System.out.println("Document has no title.");
  +        }
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to