juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r1329389 - in /juddi/trunk: juddi-core-openjpa/src/test/java/org/apache/juddi/config/ApplicationConfigurationTest.java juddi-core/src/main/java/org/apache/juddi/config/Install.java
Date Mon, 23 Apr 2012 19:28:56 GMT
Author: kstam
Date: Mon Apr 23 19:28:56 2012
New Revision: 1329389

URL: http://svn.apache.org/viewvc?rev=1329389&view=rev
Log:
JUDDI-382 always going through getURI() first.

Modified:
    juddi/trunk/juddi-core-openjpa/src/test/java/org/apache/juddi/config/ApplicationConfigurationTest.java
    juddi/trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java

Modified: juddi/trunk/juddi-core-openjpa/src/test/java/org/apache/juddi/config/ApplicationConfigurationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core-openjpa/src/test/java/org/apache/juddi/config/ApplicationConfigurationTest.java?rev=1329389&r1=1329388&r2=1329389&view=diff
==============================================================================
--- juddi/trunk/juddi-core-openjpa/src/test/java/org/apache/juddi/config/ApplicationConfigurationTest.java
(original)
+++ juddi/trunk/juddi-core-openjpa/src/test/java/org/apache/juddi/config/ApplicationConfigurationTest.java
Mon Apr 23 19:28:56 2012
@@ -14,6 +14,10 @@
  */
 package org.apache.juddi.config;
 
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
 import org.apache.commons.configuration.ConfigurationException;
 import org.junit.Assert;
 import org.junit.Test;
@@ -50,4 +54,25 @@ public class ApplicationConfigurationTes
 		}
 	}
 	
+	@Test
+	public void testURLFormats() throws MalformedURLException, URISyntaxException {
+		
+		URI file = new URI("file:/tmp/");
+		String path = file.getSchemeSpecificPart();
+		Assert.assertEquals("/tmp/", path);
+		
+		URI fileInJar = new URI("jar:file:/tmp/my.jar!/");
+		String path1 = fileInJar.getSchemeSpecificPart();
+		Assert.assertEquals("file:/tmp/my.jar!/", path1);
+				
+		URI fileInZip = new URI("zip:D:/bea/tmp/_WL_user/JuddiEAR/nk4cwv/war/WEB-INF/lib/juddi-core-3.0.1.jar!");
+		String path2 = fileInZip.getSchemeSpecificPart();
+		Assert.assertEquals("D:/bea/tmp/_WL_user/JuddiEAR/nk4cwv/war/WEB-INF/lib/juddi-core-3.0.1.jar!",
path2);
+		
+		URI fileInVfszip = new URI("vfsfile:/tmp/SOA%20Platform/jbossesb-registry.sar/juddi_custom_install_data/root_Publisher.xml");
+		String path3 = fileInVfszip.getSchemeSpecificPart();
+		Assert.assertEquals("/tmp/SOA Platform/jbossesb-registry.sar/juddi_custom_install_data/root_Publisher.xml",
path3);
+		
+	}
+	
 }

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java?rev=1329389&r1=1329388&r2=1329389&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java Mon Apr 23 19:28:56
2012
@@ -507,12 +507,14 @@ public class Install {
 		}
 		
 		String path = null;
+		
 		try {
-			path = url.toURI().getPath();
+			path = url.toURI().getSchemeSpecificPart();
 		} catch (URISyntaxException e) {
 			throw new ConfigurationException(e);
 		}
 		
+		
 		File dir = new File(path);
 		String rootPublisherStr = config.getString(Property.JUDDI_ROOT_PUBLISHER);
 		if (dir.exists()) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org


Mime
View raw message