geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r392149 - /geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven2Repository.java
Date Fri, 07 Apr 2006 01:25:39 GMT
Author: ammulder
Date: Thu Apr  6 18:25:36 2006
New Revision: 392149

URL: http://svn.apache.org/viewcvs?rev=392149&view=rev
Log:
Don't ignore CARs that are unpacked directories (a bit of a hack, but hey)

Modified:
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven2Repository.java

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven2Repository.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven2Repository.java?rev=392149&r1=392148&r2=392149&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven2Repository.java
(original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven2Repository.java
Thu Apr  6 18:25:36 2006
@@ -103,15 +103,34 @@
             File file = files[i];
             if (file.canRead()) {
                 if (file.isDirectory()) {
+                    File test = new File(file, "META-INF");
+                    if(test.exists() && test.isDirectory() && test.canRead()
&& groupId != null) {
+                        String version = versionDir.getName();
+                        String fileHeader = artifactId + "-" + version + ".";
 
-                    String nextGroupId;
-                    if (groupId == null) {
-                        nextGroupId = artifactId;
-                    } else {
-                        nextGroupId = groupId + "." + artifactId;
-                    }
+                        String fileName = file.getName();
+                        if (fileName.startsWith(fileHeader)) {
+                            // type is everything after the file header
+                            String type = fileName.substring(fileHeader.length());
+
+                            if (!type.endsWith(".sha1") && !type.endsWith(".md5"))
{
+                                artifacts.add(new Artifact(groupId,
+                                        artifactId,
+                                        version,
+                                        type
+                                ));
+                            }
+                        }
+                    } else { // this is just part of the path to the artifact
+                        String nextGroupId;
+                        if (groupId == null) {
+                            nextGroupId = artifactId;
+                        } else {
+                            nextGroupId = groupId + "." + artifactId;
+                        }
 
-                    artifacts.addAll(getArtifacts(nextGroupId, file));
+                        artifacts.addAll(getArtifacts(nextGroupId, file));
+                    }
                 } else if (groupId != null) {
                     String version = versionDir.getName();
                     String fileHeader = artifactId + "-" + version + ".";



Mime
View raw message