Author: rsearls
Date: 2013-12-16 10:23:11 -0500 (Mon, 16 Dec 2013)
New Revision: 18181
Modified:
common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils/ResourceURL.java
Log:
JBPAPP-10417: added URLEncoder.encode for MAC OS X env
Modified:
common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils/ResourceURL.java
===================================================================
---
common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils/ResourceURL.java 2013-12-13
20:43:53 UTC (rev 18180)
+++
common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/ws/core/utils/ResourceURL.java 2013-12-16
15:23:11 UTC (rev 18181)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.net.URLEncoder;
/**
* A wrapper around an URL that can handle input streams for resources in nested jars.
@@ -52,7 +53,16 @@
public InputStream openStream() throws IOException
{
boolean isJarUrl = "jar".equals(targetURL.getProtocol());
- return isJarUrl ? new JarUrlConnection(targetURL).getInputStream() :
targetURL.openStream();
+
+ //- JBPAPP-10417 handling of spaces in path.
+ URL tmpTargetURL = this.targetURL;
+ if (System.getProperty("os.name").toLowerCase().startsWith("mac os
x")){
+ tmpTargetURL = new URL(targetURL.getProtocol(), targetURL.getHost(),
+ targetURL.getPort(), URLEncoder.encode(targetURL.getFile(),
"UTF-8"));
+ }
+
+ return isJarUrl ? new JarUrlConnection(tmpTargetURL).getInputStream() :
tmpTargetURL.openStream();
+
}
public int hashCode()
Show replies by date