Skip to content
Permalink
Browse files
TENTACLES-7 Scan archives in EAR and RAR files.
- Applied modified patch from Jonathan Gallimore from Jira.



git-svn-id: https://svn.apache.org/repos/asf/creadur/tentacles/trunk@1620516 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
ottlinger committed Aug 26, 2014
1 parent 41abe62 commit dae74247dd8b85d9e261fea31a1721029201bda1
Showing 3 changed files with 6 additions and 3 deletions.
@@ -14,3 +14,4 @@
*/*.iws
.idea/*
*/.idea
/target/
@@ -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 @@ private Set<File> mirrorRepositoryFrom(final Configuration configuration)
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)));
@@ -23,6 +23,7 @@

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 @@ public boolean accept(final File pathname) {
}

private boolean isValidArchive(final String path) {
return path.matches(".*\\.(jar|zip|war|ear|tar.gz)");
return path.matches(MATCH_PATTERN);
}
}
}

0 comments on commit dae7424

Please sign in to comment.