servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r940420 - /servicemix/maven-plugins/docs-maven-plugin/trunk/src/main/java/org/apache/servicemix/docs/ConfluenceToDocbookMojo.java
Date Mon, 03 May 2010 11:27:49 GMT
Author: gertv
Date: Mon May  3 11:27:49 2010
New Revision: 940420

URL: http://svn.apache.org/viewvc?rev=940420&view=rev
Log:
No confluence-to-docbook conversion for .*

Modified:
    servicemix/maven-plugins/docs-maven-plugin/trunk/src/main/java/org/apache/servicemix/docs/ConfluenceToDocbookMojo.java

Modified: servicemix/maven-plugins/docs-maven-plugin/trunk/src/main/java/org/apache/servicemix/docs/ConfluenceToDocbookMojo.java
URL: http://svn.apache.org/viewvc/servicemix/maven-plugins/docs-maven-plugin/trunk/src/main/java/org/apache/servicemix/docs/ConfluenceToDocbookMojo.java?rev=940420&r1=940419&r2=940420&view=diff
==============================================================================
--- servicemix/maven-plugins/docs-maven-plugin/trunk/src/main/java/org/apache/servicemix/docs/ConfluenceToDocbookMojo.java
(original)
+++ servicemix/maven-plugins/docs-maven-plugin/trunk/src/main/java/org/apache/servicemix/docs/ConfluenceToDocbookMojo.java
Mon May  3 11:27:49 2010
@@ -16,6 +16,7 @@
 package org.apache.servicemix.docs;
 
 import java.io.File;
+import java.io.FileFilter;
 import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -48,12 +49,17 @@ public class ConfluenceToDocbookMojo ext
      */
     protected File output;
 
+    /**
+     * Filter to determine which files to convert 
+     */
+    private final FileFilter filter = new DefaultFileFilterImpl();
+
     public void execute() throws MojoExecutionException {
         if (!output.exists()) {
             output.mkdirs();
         }
         if (input.exists() && input.isDirectory()) {
-            for (File file : input.listFiles()) {
+            for (File file : input.listFiles(filter)) {
                 getLog().info("Creating DocBook from " + file.getAbsolutePath());
                 FileWriter writer = null;
                 try {
@@ -77,4 +83,13 @@ public class ConfluenceToDocbookMojo ext
             }
         }
     }
+
+    /*
+     * Default FileFilter implementation to filter out hidden files (e.g. .svn)
+     */
+    private class DefaultFileFilterImpl implements FileFilter {
+        public boolean accept(File file) {
+            return !file.getName().startsWith(".");  
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message