geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r372366 - /geronimo/branches/1.0/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java
Date Wed, 25 Jan 2006 23:39:26 GMT
Author: ammulder
Date: Wed Jan 25 15:39:24 2006
New Revision: 372366

URL: http://svn.apache.org/viewcvs?rev=372366&view=rev
Log:
Emit a warning for files in the repository with no version in the name
  GERONIMO-1468

Modified:
    geronimo/branches/1.0/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java

Modified: geronimo/branches/1.0/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java?rev=372366&r1=372365&r2=372366&view=diff
==============================================================================
--- geronimo/branches/1.0/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java
(original)
+++ geronimo/branches/1.0/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java
Wed Jan 25 15:39:24 2006
@@ -110,24 +110,26 @@
     private static final Pattern pattern = Pattern.compile("(.+)/(.+)s/(.+)-([0-9].+)\\.([^0-9]+)");
 
     public URI[] listURIs() throws URISyntaxException {
-        String[] results = getFiles(rootFile, "");
-        URI[] out = new URI[results.length];
+        String[] names = getFiles(rootFile, "");
+        List results = new ArrayList(names.length);
         Matcher matcher = pattern.matcher("");
-        for (int i = 0; i < out.length; i++) {
-            matcher.reset(results[i]);
+        for (int i = 0; i < names.length; i++) {
+            matcher.reset(names[i]);
             if (matcher.matches()) {
                 String groupId = matcher.group(1);
                 String artifactId = matcher.group(3);
                 String version = matcher.group(4);
                 String type = matcher.group(5);
                 StringBuffer buf = new StringBuffer(groupId).append("/").append(artifactId).append("/").append(version).append("/").append(type);
-                out[i] = new URI(buf.toString());
+                results.add(new URI(buf.toString()));
             } else {
-                //??
+            	log.warn("could not resolve URI for malformed repository entry: " + names[i]
+
+            	" - the filename should look like: <groupId>/<type>s/<artifactId>-<version>.<type>
  "+
+                "Perhaps you put in a file without a version number in the name?");
             }
 
         }
-        return out;
+       	return (URI[])results.toArray(new URI[results.size()]);
     }
 
     public String[] getFiles(File base, String prefix) {



Mime
View raw message