gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r759922 - in /gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy: Main.java resources/GumpArtifact.java
Date Mon, 30 Mar 2009 11:18:37 GMT
Author: bodewig
Date: Mon Mar 30 11:18:37 2009
New Revision: 759922

URL: http://svn.apache.org/viewvc?rev=759922&view=rev
Log:
dots in groupIds are translated into directories by mvn

Modified:
    gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/Main.java
    gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/resources/GumpArtifact.java

Modified: gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/Main.java
URL: http://svn.apache.org/viewvc/gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/Main.java?rev=759922&r1=759921&r2=759922&view=diff
==============================================================================
--- gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/Main.java (original)
+++ gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/Main.java Mon Mar 30 11:18:37
2009
@@ -98,8 +98,14 @@
                     // known artifacts or proxy requests for jars
                     Route r = router.attach(Constants.JAR_ARTIFACT_TEMPLATE,
                                             Jar.class);
+                    r.getTemplate().getVariables()
+                        .put(Constants.GROUP_ID,
+                             new Variable(Variable.TYPE_URI_PATH));
                     r = router.attach(Constants.CHECKSUM_ARTIFACT_TEMPLATE,
                                       Checksum.class);
+                    r.getTemplate().getVariables()
+                        .put(Constants.GROUP_ID,
+                             new Variable(Variable.TYPE_URI_PATH));
 
                     // other resources
                     router.attach("/proxyLog.html", LogFile.class);

Modified: gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/resources/GumpArtifact.java
URL: http://svn.apache.org/viewvc/gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/resources/GumpArtifact.java?rev=759922&r1=759921&r2=759922&view=diff
==============================================================================
--- gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/resources/GumpArtifact.java (original)
+++ gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/resources/GumpArtifact.java Mon
Mar 30 11:18:37 2009
@@ -43,8 +43,7 @@
     public GumpArtifact(Context ctx, Request request, Response response,
                         Variant type) {
         super(ctx, request, response);
-        fileName = Registry.getArtifactPath((String) request.getAttributes()
-                                            .get(Constants.GROUP_ID),
+        fileName = Registry.getArtifactPath(getGroupId(request),
                                             (String) request.getAttributes()
                                             .get(Constants.ARTIFACT_ID));
         getVariants().add(type);
@@ -84,12 +83,20 @@
     private void log(String start) {
         getLogger().info(start + " " + getArtifactType()
                          + " artifact for groupId '"
-                         + getRequest().getAttributes()
-                         .get(Constants.GROUP_ID)
+                         + getGroupId()
                          + "' and artifactId '"
                          + getRequest().getAttributes()
                          .get(Constants.ARTIFACT_ID)
                          + "'");
     }
     
+
+    protected final String getGroupId() {
+        return getGroupId(getRequest());
+    }
+
+    protected static String getGroupId(Request request) {
+        String s = (String) request.getAttributes().get(Constants.GROUP_ID);
+        return s != null ? s.replace("/", ".") : s;
+    }
 }
\ No newline at end of file



Mime
View raw message