creadur-commits mailing list archives

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

URL: http://svn.apache.org/r1462783
Log:
Switch to longer, more descriptive names

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=1462783&r1=1462782&r2=1462783&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:44:09 2013
@@ -41,12 +41,12 @@ public class Configuration {
         return uri;
     }
 
-    private final URI staging;
+    private final URI stagingRepositoryURI;
     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.stagingRepositoryURI = toURI(args[ARGUMENT_INDEX_FOR_URI_CONFIGURATION]);
         this.rootDirectoryForLocalOutput = rootDirectoryForLocalOutput(args);
         this.fileRepositoryPathNameFilter =
                 System.getProperty(
@@ -58,8 +58,8 @@ public class Configuration {
         return this.fileRepositoryPathNameFilter;
     }
 
-    public URI getStaging() {
-        return this.staging;
+    public URI getStagingRepositoryURI() {
+        return this.stagingRepositoryURI;
     }
 
     public String getRootDirectoryForLocalOutput() {
@@ -72,7 +72,7 @@ public class Configuration {
             rootDirectoryForLocal =
                     args[ARGUMENT_INDEX_FOR_LOCAL_ROOT_DIRECTORY];
         } else {
-            rootDirectoryForLocal = new File(this.staging.getPath()).getName();
+            rootDirectoryForLocal = new File(this.stagingRepositoryURI.getPath()).getName();
         }
         return rootDirectoryForLocal;
     }

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=1462783&r1=1462782&r2=1462783&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:44:09 2013
@@ -82,8 +82,9 @@ public class Main {
         Files.mkdirs(this.repository);
         Files.mkdirs(this.content);
 
-        log.info("Repo: " + this.configuration.getStaging());
-        log.info("Local: " + this.local);
+        log.info("Remote repository: "
+                + this.configuration.getStagingRepositoryURI());
+        log.info("Local root directory: " + this.local);
 
         this.reports = new Reports();
 
@@ -327,9 +328,11 @@ public class Main {
     private void prepare() throws URISyntaxException, IOException {
         final Set<File> files = new HashSet<File>();
 
-        if (this.configuration.getStaging().toString().startsWith("http")) {
+        if (this.configuration.getStagingRepositoryURI().toString()
+                .startsWith("http")) {
             final Set<URI> resources =
-                    this.client.crawl(this.configuration.getStaging());
+                    this.client.crawl(this.configuration
+                            .getStagingRepositoryURI());
 
             for (final URI uri : resources) {
                 if (!uri.getPath().matches(".*(war|jar|zip)")) {
@@ -337,14 +340,16 @@ public class Main {
                 }
                 files.add(download(uri));
             }
-        } else if (this.configuration.getStaging().toString()
+        } else if (this.configuration.getStagingRepositoryURI().toString()
                 .startsWith("file:")) {
-            final File file = new File(this.configuration.getStaging());
+            final File file =
+                    new File(this.configuration.getStagingRepositoryURI());
             final List<File> collect = Files.collect(file, new FileFilter() {
                 @Override
                 public boolean accept(final File pathname) {
                     final String path = pathname.getAbsolutePath();
-                    return path.matches(Main.this.configuration.getFileRepositoryPathNameFilter())
+                    return path.matches(Main.this.configuration
+                            .getFileRepositoryPathNameFilter())
                             && isValidArchive(path);
                 }
             });
@@ -782,8 +787,9 @@ public class Main {
     private File getFile(final URI uri) {
         final String name =
                 uri.toString()
-                        .replace(this.configuration.getStaging().toString(), "")
-                        .replaceFirst("^/", "");
+                        .replace(
+                                this.configuration.getStagingRepositoryURI()
+                                        .toString(), "").replaceFirst("^/", "");
         return new File(this.repository, name);
     }
 



Mime
View raw message