creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1462781 - in /creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles: Configuration.java Main.java
Date Sat, 30 Mar 2013 15:25:30 GMT
Author: rdonkin
Date: Sat Mar 30 15:25:30 2013
New Revision: 1462781

URL: http://svn.apache.org/r1462781
Log:
Push file repository path name filter into configuration

Modified:
    creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Configuration.java
    creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Main.java

Modified: creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Configuration.java
URL: http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Configuration.java?rev=1462781&r1=1462780&r2=1462781&view=diff
==============================================================================
--- creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Configuration.java
(original)
+++ creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Configuration.java
Sat Mar 30 15:25:30 2013
@@ -24,6 +24,10 @@ import java.net.URISyntaxException;
 
 public class Configuration {
 
+    private static final String DEFAULT_FILE_REPOSITORY_PATH_NAME_FILTER =
+            "org/apache/openejb";
+    private static final String SYSTEM_PROPERTY_NAME_FOR_FILE_REPOSITORY_PATH_NAME_FILTER
=
+            "filter";
     private static final int ARGUMENT_INDEX_FOR_LOCAL_ROOT_DIRECTORY = 1;
     private static final int ARGUMENT_INDEX_FOR_URI_CONFIGURATION = 0;
     private static final int ARGUMENT_LENGTH_FOR_URI_CONFIGURATION_ONLY =
@@ -39,10 +43,19 @@ public class Configuration {
 
     private final URI staging;
     private final String rootDirectoryForLocalOutput;
+    private final String fileRepositoryPathNameFilter;
 
     public Configuration(final String... args) throws URISyntaxException {
         this.staging = toURI(args[ARGUMENT_INDEX_FOR_URI_CONFIGURATION]);
         this.rootDirectoryForLocalOutput = rootDirectoryForLocalOutput(args);
+        this.fileRepositoryPathNameFilter =
+                System.getProperty(
+                        SYSTEM_PROPERTY_NAME_FOR_FILE_REPOSITORY_PATH_NAME_FILTER,
+                        DEFAULT_FILE_REPOSITORY_PATH_NAME_FILTER);
+    }
+
+    public String getFileRepositoryPathNameFilter() {
+        return this.fileRepositoryPathNameFilter;
     }
 
     public URI getStaging() {

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=1462781&r1=1462780&r2=1462781&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 Sat Mar 30
15:25:30 2013
@@ -60,7 +60,6 @@ public class Main {
     private final File content;
     private final Reports reports;
     private final Map<String, String> licenses = new HashMap<String, String>();
-    private final String filter;
     private final NexusClient client = new NexusClient();
 
     private final Configuration configuration;
@@ -88,7 +87,6 @@ public class Main {
 
         this.reports = new Reports();
 
-        this.filter = System.getProperty("filter", "org/apache/openejb");
         final URL style =
                 this.getClass().getClassLoader().getResource("legal/style.css");
         IO.copy(style.openStream(), new File(this.local, "style.css"));
@@ -346,7 +344,7 @@ public class Main {
                 @Override
                 public boolean accept(final File pathname) {
                     final String path = pathname.getAbsolutePath();
-                    return path.matches(Main.this.filter)
+                    return path.matches(Main.this.configuration.getFileRepositoryPathNameFilter())
                             && isValidArchive(path);
                 }
             });



Mime
View raw message