jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mets...@apache.org
Subject svn commit: r1062917 - in /incubator/jspwiki/trunk: ChangeLog src/java/org/apache/wiki/Release.java src/java/org/apache/wiki/search/LuceneSearchProvider.java
Date Mon, 24 Jan 2011 18:38:42 GMT
Author: metskem
Date: Mon Jan 24 18:38:42 2011
New Revision: 1062917

URL: http://svn.apache.org/viewvc?rev=1062917&view=rev
Log:
3.0.0-svn-224
        * Extended the list of lucene searchable file suffixes, we now do 
           ".txt", ".ini", ".xml", ".html", "htm", ".mm", ".htm", ".xhtml", ".java", ".c",
".cpp",
            ".php", ".asm", ".sh",  ".properties", ".kml", ".gpx", ".loc"

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/search/LuceneSearchProvider.java

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=1062917&r1=1062916&r2=1062917&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Mon Jan 24 18:38:42 2011
@@ -1,3 +1,11 @@
+2011-01-24  Harry Metske <metskem@apache.org>
+
+        * 3.0.0-svn-224
+        
+        * Extended the list of lucene searchable file suffixes, we now do 
+           ".txt", ".ini", ".xml", ".html", "htm", ".mm", ".htm", ".xhtml", ".java", ".c",
".cpp",
+            ".php", ".asm", ".sh",  ".properties", ".kml", ".gpx", ".loc"
+
 2010-12-12  Harry Metske <metskem@apache.org>
 
         * 3.0.0-svn-223

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java?rev=1062917&r1=1062916&r2=1062917&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Mon Jan 24 18:38:42 2011
@@ -77,7 +77,7 @@ public final class Release
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "223";
+    public static final String     BUILD         = "224";
 
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/search/LuceneSearchProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/search/LuceneSearchProvider.java?rev=1062917&r1=1062916&r2=1062917&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/search/LuceneSearchProvider.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/search/LuceneSearchProvider.java Mon
Jan 24 18:38:42 2011
@@ -88,6 +88,11 @@ public class LuceneSearchProvider implem
      *  Number of page updates before we optimize the index.
      */
     public static final int LUCENE_OPTIMIZE_COUNT      = 10;
+    /** These attachment file suffixes will be indexed. */
+    public static final String[] SEARCHABLE_FILE_SUFFIXES = new String[] { ".txt", ".ini",
".xml", ".html", "htm", ".mm", ".htm",
+                                                                          ".xhtml", ".java",
".c", ".cpp", ".php", ".asm", ".sh",
+                                                                          ".properties",
".kml", ".gpx", ".loc" };
+
     protected static final String LUCENE_ID            = "id";
     protected static final String LUCENE_PAGE_CONTENTS = "contents";
     protected static final String LUCENE_AUTHOR        = "author";
@@ -313,10 +318,16 @@ public class LuceneSearchProvider implem
 
         String filename = att.getFileName();
 
-        if(filename.endsWith(".txt") ||
-           filename.endsWith(".xml") ||
-           filename.endsWith(".ini") ||
-           filename.endsWith(".html"))
+        boolean searchSuffix = false;
+        for( String suffix : SEARCHABLE_FILE_SUFFIXES )
+        {
+            if( filename.endsWith( suffix ) )
+            {
+                searchSuffix = true;
+            }
+        }
+
+        if( searchSuffix )
         {
             InputStream attStream;
 



Mime
View raw message