geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r399079 - in /geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console: databasemanager/wizard/DatabasePoolPortlet.java jmsmanager/wizard/AbstractHandler.java
Date Tue, 02 May 2006 23:15:37 GMT
Author: ammulder
Date: Tue May  2 16:15:34 2006
New Revision: 399079

URL: http://svn.apache.org/viewcvs?rev=399079&view=rev
Log:
A little cleanup related to and suggested by GERONIMO-1426

Modified:
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java?rev=399079&r1=399078&r2=399079&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
Tue May  2 16:15:34 2006
@@ -872,12 +872,8 @@
             data.name = data.name.replaceAll("\\s", "");
             DeploymentManager mgr = PortletManager.getDeploymentManager(request);
             try {
-                URL url = getRAR(request, data.getRarPath()).toURL();
-                String str = url.toString();
-                if(str.indexOf(' ') > -1) {
-                    url = new URL(str.replaceAll(" ", "%20")); // try to avoid problems with
spaces in path on Windows
-                }
-                ConnectorDeployable deployable = new ConnectorDeployable(url);
+                File rarFile = getRAR(request, data.getRarPath());
+                ConnectorDeployable deployable = new ConnectorDeployable(rarFile.toURL());
                 DeploymentConfiguration config = mgr.createConfiguration(deployable);
                 final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
                 Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
@@ -970,7 +966,7 @@
                     out.flush();
                     out.close();
                     Target[] targets = mgr.getTargets();
-                    ProgressObject po = mgr.distribute(targets, new File(url.getPath()),
tempFile);
+                    ProgressObject po = mgr.distribute(targets, rarFile, tempFile);
                     waitForProgress(po);
                     if(po.getDeploymentStatus().isCompleted()) {
                         TargetModuleID[] ids = po.getResultTargetModuleIDs();
@@ -1037,11 +1033,11 @@
     }
 
     private static File getRAR(PortletRequest request, String rarPath) {
-        org.apache.geronimo.kernel.repository.Artifact uri = org.apache.geronimo.kernel.repository.Artifact.create(rarPath);
+        org.apache.geronimo.kernel.repository.Artifact artifact = org.apache.geronimo.kernel.repository.Artifact.create(rarPath);
         Repository[] repos = PortletManager.getCurrentServer(request).getRepositories();
         for (int i = 0; i < repos.length; i++) {
             Repository repo = repos[i];
-            File url = repo.getLocation(uri);
+            File url = repo.getLocation(artifact);
             if (url != null) {
                 if (url.exists() && url.canRead() && !url.isDirectory())
{
                     return url;

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java?rev=399079&r1=399078&r2=399079&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java
Tue May  2 16:15:34 2006
@@ -16,53 +16,44 @@
  */
 package org.apache.geronimo.console.jmsmanager.wizard;
 
-import javax.enterprise.deploy.model.DDBean;
-import javax.enterprise.deploy.model.DDBeanRoot;
-import javax.enterprise.deploy.spi.DeploymentConfiguration;
-import javax.enterprise.deploy.spi.DeploymentManager;
-import javax.enterprise.deploy.spi.Target;
-import javax.enterprise.deploy.spi.TargetModuleID;
-import javax.enterprise.deploy.spi.status.ProgressObject;
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.PortletSession;
 import java.io.BufferedOutputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import java.util.Iterator;
-import java.net.URL;
-import org.apache.geronimo.console.util.PortletManager;
-import org.apache.geronimo.console.MultiPageAbstractHandler;
-import org.apache.geronimo.console.MultiPageModel;
-import org.apache.geronimo.deployment.service.jsr88.EnvironmentData;
-import org.apache.geronimo.deployment.tools.loader.ConnectorDeployable;
+import javax.enterprise.deploy.model.DDBean;
+import javax.enterprise.deploy.model.DDBeanRoot;
+import javax.enterprise.deploy.spi.DeploymentConfiguration;
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.connector.deployment.jsr88.AdminObjectDCB;
+import org.apache.geronimo.connector.deployment.jsr88.AdminObjectInstance;
+import org.apache.geronimo.connector.deployment.jsr88.ConnectionDefinition;
+import org.apache.geronimo.connector.deployment.jsr88.ConnectionDefinitionInstance;
 import org.apache.geronimo.connector.deployment.jsr88.Connector15DCBRoot;
 import org.apache.geronimo.connector.deployment.jsr88.ConnectorDCB;
 import org.apache.geronimo.connector.deployment.jsr88.ResourceAdapter;
 import org.apache.geronimo.connector.deployment.jsr88.ResourceAdapterInstance;
-import org.apache.geronimo.connector.deployment.jsr88.ConnectionDefinition;
-import org.apache.geronimo.connector.deployment.jsr88.ConnectionDefinitionInstance;
 import org.apache.geronimo.connector.deployment.jsr88.SinglePool;
-import org.apache.geronimo.connector.deployment.jsr88.AdminObjectDCB;
-import org.apache.geronimo.connector.deployment.jsr88.AdminObjectInstance;
-import org.apache.geronimo.naming.deployment.jsr88.GBeanLocator;
+import org.apache.geronimo.console.MultiPageAbstractHandler;
+import org.apache.geronimo.console.MultiPageModel;
+import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.deployment.service.jsr88.EnvironmentData;
+import org.apache.geronimo.deployment.tools.loader.ConnectorDeployable;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.naming.deployment.jsr88.GBeanLocator;
 
 /**
  * Base class for portlet helpers
@@ -475,12 +466,8 @@
             //data.instanceName = data.instanceName.replaceAll("\\s", "");
             DeploymentManager mgr = PortletManager.getDeploymentManager(request);
             try {
-                URL url = PortletManager.getRepositoryEntry(request, data.getRarURI()).toURL();
-                String str = url.toString();
-                if(str.indexOf(' ') > -1) {
-                    url = new URL(str.replaceAll(" ", "%20")); // try to avoid problems with
spaces in path on Windows
-                }
-                ConnectorDeployable deployable = new ConnectorDeployable(url);
+                File rarFile = PortletManager.getRepositoryEntry(request, data.getRarURI());
+                ConnectorDeployable deployable = new ConnectorDeployable(rarFile.toURL());
                 DeploymentConfiguration config = mgr.createConfiguration(deployable);
                 final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
                 Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
@@ -630,7 +617,7 @@
                     out.flush();
                     out.close();
                     Target[] targets = mgr.getTargets();
-                    ProgressObject po = mgr.distribute(targets, new File(url.getPath()),
tempFile);
+                    ProgressObject po = mgr.distribute(targets, rarFile, tempFile);
                     waitForProgress(po);
                     if(po.getDeploymentStatus().isCompleted()) {
                         TargetModuleID[] ids = po.getResultTargetModuleIDs();



Mime
View raw message