pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1603552 - in /pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples: ant/PDFToTextTask.java lucene/IndexPDFFiles.java
Date Wed, 18 Jun 2014 17:58:37 GMT
Author: tilman
Date: Wed Jun 18 17:58:37 2014
New Revision: 1603552

URL: http://svn.apache.org/r1603552
Log:
PDFBOX-2147: use foreach loop

Modified:
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/ant/PDFToTextTask.java
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/lucene/IndexPDFFiles.java

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/ant/PDFToTextTask.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/ant/PDFToTextTask.java?rev=1603552&r1=1603551&r2=1603552&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/ant/PDFToTextTask.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/ant/PDFToTextTask.java
Wed Jun 18 17:58:37 2014
@@ -62,9 +62,9 @@ public class PDFToTextTask extends Task
             DirectoryScanner dirScanner = next.getDirectoryScanner( getProject() );
             dirScanner.scan();
             String[] files = dirScanner.getIncludedFiles();
-            for( int i=0; i<files.length; i++ )
+            for (String file : files)
             {
-                File f = new File( dirScanner.getBasedir(), files[i] );
+                File f = new File(dirScanner.getBasedir(), file);
                 log( "processing: " + f.getAbsolutePath() );
                 String pdfFile = f.getAbsolutePath();
                 if( pdfFile.toUpperCase().endsWith( ".PDF" ) )

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/lucene/IndexPDFFiles.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/lucene/IndexPDFFiles.java?rev=1603552&r1=1603551&r2=1603552&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/lucene/IndexPDFFiles.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/lucene/IndexPDFFiles.java
Wed Jun 18 17:58:37 2014
@@ -172,9 +172,9 @@ public class IndexPDFFiles
                 // an IO error could occur
                 if (files != null)
                 {
-                    for (int i = 0; i < files.length; i++)
+                    for (String fileName : files)
                     {
-                        indexDocs(writer, new File(file, files[i]));
+                        indexDocs(writer, new File(file, fileName));
                     }
                 }
             }



Mime
View raw message