creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1548135 - /creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/impl/guesser/ArchiveGuesser.java
Date Thu, 05 Dec 2013 13:49:16 GMT
Author: rdonkin
Date: Thu Dec  5 13:49:16 2013
New Revision: 1548135

URL: http://svn.apache.org/r1548135
Log:
Inject configuration through constructor.

Modified:
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/impl/guesser/ArchiveGuesser.java

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/impl/guesser/ArchiveGuesser.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/impl/guesser/ArchiveGuesser.java?rev=1548135&r1=1548134&r2=1548135&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/impl/guesser/ArchiveGuesser.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/impl/guesser/ArchiveGuesser.java
Thu Dec  5 13:49:16 2013
@@ -31,7 +31,15 @@ public class ArchiveGuesser {
         return new ArchiveGuesser().isArchive(document.getName());
     }
 
+    private final String[] archiveExtensions;
+
     private ArchiveGuesser() {
+        this(ARCHIVE_EXTENSIONS);
+    }
+
+    public ArchiveGuesser(final String[] archiveExtensions) {
+        super();
+        this.archiveExtensions = archiveExtensions;
     }
 
     /**
@@ -42,7 +50,7 @@ public class ArchiveGuesser {
             return false;
         }
         final String nameToLower = name.toLowerCase(Locale.US);
-        for (final String element : ArchiveGuesser.ARCHIVE_EXTENSIONS) {
+        for (final String element : this.archiveExtensions) {
             if (nameToLower.endsWith("." + element)) {
                 return true;
             }



Mime
View raw message