creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1548269 - in /creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat: analysis/DefaultAnalyser.java document/impl/guesser/ArchiveGuesser.java
Date Thu, 05 Dec 2013 20:22:33 GMT
Author: rdonkin
Date: Thu Dec  5 20:22:33 2013
New Revision: 1548269

URL: http://svn.apache.org/r1548269
Log:
Push method into ArchiveGuesser, aiming to potentially extract a common interface

Modified:
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java
    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/analysis/DefaultAnalyser.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java?rev=1548269&r1=1548268&r2=1548269&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java
Thu Dec  5 20:22:33 2013
@@ -42,12 +42,10 @@ final class DefaultAnalyser implements I
         if (NoteGuesser.isNote(subject)) {
             documentCategory = MetaData.RAT_DOCUMENT_CATEGORY_DATUM_NOTICE;
         } else {
-            if (this.archiveGuesser.isArchive(subject.getName())) {
-                documentCategory =
-                        MetaData.RAT_DOCUMENT_CATEGORY_DATUM_ARCHIVE;
+            if (this.archiveGuesser.matches(subject)) {
+                documentCategory = MetaData.RAT_DOCUMENT_CATEGORY_DATUM_ARCHIVE;
             } else if (BinaryGuesser.isBinary(subject)) {
-                documentCategory =
-                        MetaData.RAT_DOCUMENT_CATEGORY_DATUM_BINARY;
+                documentCategory = MetaData.RAT_DOCUMENT_CATEGORY_DATUM_BINARY;
             } else {
                 documentCategory =
                         MetaData.RAT_DOCUMENT_CATEGORY_DATUM_STANDARD;

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=1548269&r1=1548268&r2=1548269&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 20:22:33 2013
@@ -20,6 +20,8 @@ package org.apache.rat.document.impl.gue
 
 import java.util.Locale;
 
+import org.apache.rat.api.Document;
+
 public class ArchiveGuesser {
 
     private static final String[] ARCHIVE_EXTENSIONS = { "jar", "gz", "zip",
@@ -36,6 +38,10 @@ public class ArchiveGuesser {
         this.archiveExtensions = archiveExtensions;
     }
 
+    public boolean matches(final Document subject) {
+        return isArchive(subject.getName());
+    }
+
     /**
      * Is a file by that name an archive?
      */



Mime
View raw message