You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2008/03/07 11:59:43 UTC
svn commit: r634609 - in
/servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi:
container/DeploySupport.java framework/AutoDeploymentService.java
Author: gnodet
Date: Fri Mar 7 02:59:42 2008
New Revision: 634609
URL: http://svn.apache.org/viewvc?rev=634609&view=rev
Log:
SM-1263: LwContainerComponentTest fails on windows
Modified:
servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/DeploySupport.java
servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/AutoDeploymentService.java
Modified: servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/DeploySupport.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/DeploySupport.java?rev=634609&r1=634608&r2=634609&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/DeploySupport.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/DeploySupport.java Fri Mar 7 02:59:42 2008
@@ -212,7 +212,13 @@
}
protected String getFilePrefix() {
- return isFileUrlFormat() ? "file://" : "";
+ String filePrefix = "file://";
+ String os = System.getProperty("os.name");
+ if (os.startsWith("Windows")) {
+ filePrefix = "file:///";
+ }
+
+ return isFileUrlFormat() ? filePrefix : "";
}
protected boolean isFileUrlFormat() {
Modified: servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/AutoDeploymentService.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/AutoDeploymentService.java?rev=634609&r1=634608&r2=634609&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/AutoDeploymentService.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/AutoDeploymentService.java Fri Mar 7 02:59:42 2008
@@ -18,6 +18,8 @@
import java.io.*;
import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
@@ -60,7 +62,8 @@
public class AutoDeploymentService extends BaseSystemService implements AutoDeploymentServiceMBean {
private static final Log LOG = LogFactory.getLog(AutoDeploymentService.class);
-
+
+ private static String filePrefix = "file:///";
private EnvironmentContext environmentContext;
private DeploymentService deploymentService;
private InstallationService installationService;
@@ -556,8 +559,14 @@
*/
protected static File unpackLocation(File tmpRoot, String location) throws DeploymentException {
File tmpDir = null;
- try {
- File file = new File(location);
+ File file = null;
+ try {
+ if (location.startsWith(filePrefix)) {
+ URI uri = new URI(location);
+ file = new File(uri);
+ } else {
+ file = new File(location);
+ }
if (file.isDirectory()) {
if (LOG.isDebugEnabled()) {
LOG.debug("Deploying an exploded jar/zip, we will create a temporary jar for it.");
@@ -593,6 +602,8 @@
}
} catch (IOException e) {
throw new DeploymentException(e);
+ } catch (URISyntaxException ex) {
+ throw new DeploymentException(ex);
}
return tmpDir;
}