felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject svn commit: r905833 - in /felix/trunk/framework/src/main/java/org/apache/felix/framework: ModuleImpl.java URLHandlersBundleStreamHandler.java
Date Tue, 02 Feb 2010 23:13:00 GMT
Author: pauls
Date: Tue Feb  2 23:12:59 2010
New Revision: 905833

URL: http://svn.apache.org/viewvc?rev=905833&view=rev
Log:
Remove the framework specific authority from the url on a toExternalForm as otherwise its
going to override the host and port info (FELIX-1973).

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleStreamHandler.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java?rev=905833&r1=905832&r2=905833&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java Tue Feb
 2 23:12:59 2010
@@ -1104,9 +1104,9 @@
 
          try
          {
-             return m_secureAction.createURL(
-                 FelixConstants.BUNDLE_URL_PROTOCOL,
-                 m_id, port, path, m_streamHandler);
+             return m_secureAction.createURL(null, 
+                 FelixConstants.BUNDLE_URL_PROTOCOL + "://" +  
+                 m_id + ":" + port + path, m_streamHandler);
          }
          catch (MalformedURLException ex)
          {

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleStreamHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleStreamHandler.java?rev=905833&r1=905832&r2=905833&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleStreamHandler.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleStreamHandler.java
Tue Feb  2 23:12:59 2010
@@ -91,6 +91,31 @@
             super.setURL(u, u.getProtocol(), u.getHost(), u.getPort(), "felix", u.getUserInfo(),
u.getPath(), u.getQuery(), u.getRef());
         }
     }
+
+    protected String toExternalForm(URL u) 
+    {
+        StringBuffer result = new StringBuffer();
+        result.append(u.getProtocol());
+        result.append("://");
+        result.append(u.getHost());
+        result.append(':');
+        result.append(u.getPort());
+        if (u.getPath() != null) 
+        {
+            result.append(u.getPath());
+        }
+        if (u.getQuery() != null) 
+        {
+            result.append('?');
+            result.append(u.getQuery());
+        }
+        if (u.getRef() != null) 
+        {
+            result.append("#");
+            result.append(u.getRef());
+        }
+        return result.toString();
+    }
     
     private boolean checkPermission(URL u)
     {



Mime
View raw message