geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r469646 - /geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Date Tue, 31 Oct 2006 20:44:56 GMT
Author: pmcmahan
Date: Tue Oct 31 12:44:56 2006
New Revision: 469646

URL: http://svn.apache.org/viewvc?view=rev&rev=469646
Log:
improve snapshot support for plugins

Modified:
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?view=diff&rev=469646&r1=469645&r2=469646
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Tue Oct 31 12:44:56 2006
@@ -898,14 +898,12 @@
 
 	String qualifiedVersion = configId.getVersion().toString();
 	if (configId.getVersion() instanceof SnapshotVersion) {
-	    SnapshotVersion ssVersion = (SnapshotVersion)configId.getVersion();
-	    qualifiedVersion = ssVersion.getMajorVersion() + "." + ssVersion.getMinorVersion();
-	    if (ssVersion.getTimestamp()!=null) {
-		qualifiedVersion += "-" + ssVersion.getTimestamp();
-	    }
-	    if (ssVersion.getBuildNumber()!=0) {
-		qualifiedVersion += "-" + ssVersion.getBuildNumber();
-	    }
+            SnapshotVersion ssVersion = (SnapshotVersion)configId.getVersion();
+            String timestamp = ssVersion.getTimestamp();
+            int buildNumber = ssVersion.getBuildNumber();
+            if (timestamp!=null && buildNumber!=0) {
+                qualifiedVersion = qualifiedVersion.replaceAll("SNAPSHOT", timestamp + "-"
+ buildNumber);
+            }
 	}
         return new URL(context, configId.getGroupId().replace('.','/') + "/"
                      + configId.getArtifactId() + "/" + configId.getVersion()
@@ -932,15 +930,15 @@
      *                                    in question
      */
     private static OpenResult openStream(Artifact artifact, URL[] repos, String username,
String password, ResultsFileWriteMonitor monitor) throws IOException, FailedLoginException,
MissingDependencyException {
-        if(monitor != null) {
-            monitor.getResults().setCurrentFilePercent(-1);
-            monitor.getResults().setCurrentMessage("Downloading "+artifact+"...");
-            monitor.setTotalBytes(-1); // In case the server doesn't say
-        }
         if(artifact != null) {
             if (!artifact.isResolved() || artifact.getVersion().toString().indexOf("SNAPSHOT")
>= 0) {
                 artifact = findArtifact(artifact, repos, username, password, monitor);
             }
+        }
+        if(monitor != null) {
+            monitor.getResults().setCurrentFilePercent(-1);
+            monitor.getResults().setCurrentMessage("Downloading "+artifact+"...");
+            monitor.setTotalBytes(-1); // In case the server doesn't say
         }
         InputStream in;
         LinkedList list = new LinkedList();



Mime
View raw message