poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1763483 - /poi/trunk/src/ooxml/java/org/apache/poi/extractor/CommandLineTextExtractor.java
Date Wed, 05 Oct 2016 19:59:50 GMT
Author: centic
Date: Wed Oct  5 19:59:50 2016
New Revision: 1763483

URL: http://svn.apache.org/viewvc?rev=1763483&view=rev
Log:
Print out size of extracted text in CommandLineExtractor

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/extractor/CommandLineTextExtractor.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/extractor/CommandLineTextExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/extractor/CommandLineTextExtractor.java?rev=1763483&r1=1763482&r2=1763483&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/extractor/CommandLineTextExtractor.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/extractor/CommandLineTextExtractor.java Wed Oct
 5 19:59:50 2016
@@ -33,27 +33,30 @@ public class CommandLineTextExtractor {
          System.err.println("   CommandLineTextExtractor <filename> [filename] [filename]");
          System.exit(1);
       }
-      
-      for(int i=0; i<args.length; i++) {
-         System.out.println(DIVIDER);
-         
-         File f = new File(args[i]);
-         System.out.println(f);
-         
-         POITextExtractor extractor = 
-            ExtractorFactory.createExtractor(f);
-         try {
-             POITextExtractor metadataExtractor =
-                extractor.getMetadataTextExtractor();
-             
-             System.out.println("   " + DIVIDER);
-             System.out.println(metadataExtractor.getText());
-             System.out.println("   " + DIVIDER);
-             System.out.println(extractor.getText());
-             System.out.println(DIVIDER);
-         } finally {
-             extractor.close();
-         }
-      }
+
+       for (String arg : args) {
+           System.out.println(DIVIDER);
+
+           File f = new File(arg);
+           System.out.println(f);
+
+           POITextExtractor extractor =
+                   ExtractorFactory.createExtractor(f);
+           try {
+               POITextExtractor metadataExtractor =
+                       extractor.getMetadataTextExtractor();
+
+               System.out.println("   " + DIVIDER);
+               String metaData = metadataExtractor.getText();
+               System.out.println(metaData);
+               System.out.println("   " + DIVIDER);
+               String text = extractor.getText();
+               System.out.println(text);
+               System.out.println(DIVIDER);
+               System.out.println("Had " + metaData.length() + " characters of metadata and
" + text.length() + " characters of text");
+           } finally {
+               extractor.close();
+           }
+       }
    }
 }



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


Mime
View raw message