creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pottlin...@apache.org
Subject svn commit: r1620516 - in /creadur/tentacles/trunk: .gitignore src/main/java/org/apache/creadur/tentacles/Main.java src/main/java/org/apache/creadur/tentacles/filter/IsArchiveInPathFilter.java
Date Tue, 26 Aug 2014 06:50:52 GMT
Author: pottlinger
Date: Tue Aug 26 06:50:51 2014
New Revision: 1620516

URL: http://svn.apache.org/r1620516
Log:
TENTACLES-7 Scan archives in EAR and RAR files.

- Applied modified patch from Jonathan Gallimore from Jira.


Modified:
    creadur/tentacles/trunk/.gitignore
    creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Main.java
    creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/filter/IsArchiveInPathFilter.java

Modified: creadur/tentacles/trunk/.gitignore
URL: http://svn.apache.org/viewvc/creadur/tentacles/trunk/.gitignore?rev=1620516&r1=1620515&r2=1620516&view=diff
==============================================================================
--- creadur/tentacles/trunk/.gitignore (original)
+++ creadur/tentacles/trunk/.gitignore Tue Aug 26 06:50:51 2014
@@ -14,3 +14,4 @@
 */*.iws
 .idea/*
 */.idea
+/target/

Modified: creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Main.java
URL: http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Main.java?rev=1620516&r1=1620515&r2=1620516&view=diff
==============================================================================
--- creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Main.java (original)
+++ creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Main.java Tue Aug 26
06:50:51 2014
@@ -54,6 +54,7 @@ public class Main {
 
     private static final org.apache.log4j.Logger log = org.apache.log4j.Logger
             .getLogger(Main.class);
+    private static final String CRAWL_PATTERN = ".*\\.(jar|zip|war|ear|rar|tar.gz)";
 
     private final Reports reports;
     private final Licenses licenses;
@@ -323,7 +324,7 @@ public class Main {
                     client.crawl(configuration.getStagingRepositoryURI());
 
             for (final URI uri : resources) {
-                if (!uri.getPath().matches(".*(war|jar|zip)")) {
+                if (!uri.getPath().matches(CRAWL_PATTERN)) {
                     continue;
                 }
                 files.add(client.download(uri, mirroredFrom(uri)));

Modified: creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/filter/IsArchiveInPathFilter.java
URL: http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/filter/IsArchiveInPathFilter.java?rev=1620516&r1=1620515&r2=1620516&view=diff
==============================================================================
--- creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/filter/IsArchiveInPathFilter.java
(original)
+++ creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/filter/IsArchiveInPathFilter.java
Tue Aug 26 06:50:51 2014
@@ -23,6 +23,7 @@ import java.io.FileFilter;
 
 final class IsArchiveInPathFilter implements FileFilter {
 
+    private static final String MATCH_PATTERN = ".*\\.(jar|zip|war|ear|rar|tar.gz)";
     private final String pathNameFilter;
 
     IsArchiveInPathFilter(final String pathNameFilter) {
@@ -37,6 +38,6 @@ final class IsArchiveInPathFilter implem
     }
 
     private boolean isValidArchive(final String path) {
-        return path.matches(".*\\.(jar|zip|war|ear|tar.gz)");
+        return path.matches(MATCH_PATTERN);
     }
-}
\ No newline at end of file
+}



Mime
View raw message