rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject svn commit: r1178704 - /incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/auth/ClasspathAwareDefaultSecurityTokenCodec.java
Date Tue, 04 Oct 2011 06:56:03 GMT
Author: jasha
Date: Tue Oct  4 06:56:03 2011
New Revision: 1178704

URL: http://svn.apache.org/viewvc?rev=1178704&view=rev
Log:
RAVE-292 Use URI#getPath to support reading the security token key file from a classpath that
contains a space character

Modified:
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/auth/ClasspathAwareDefaultSecurityTokenCodec.java

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/auth/ClasspathAwareDefaultSecurityTokenCodec.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/auth/ClasspathAwareDefaultSecurityTokenCodec.java?rev=1178704&r1=1178703&r2=1178704&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/auth/ClasspathAwareDefaultSecurityTokenCodec.java
(original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/auth/ClasspathAwareDefaultSecurityTokenCodec.java
Tue Oct  4 06:56:03 2011
@@ -19,16 +19,18 @@
 
 package org.apache.shindig.auth;
 
-import com.google.inject.AbstractModule;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.apache.shindig.config.ContainerConfig;
-
+import java.net.URI;
 import java.net.URL;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
+import com.google.inject.AbstractModule;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+import org.apache.shindig.config.ContainerConfig;
+
 /**
  * This class will only be here temporarily until we get a patch applied to Shindig to enable
loading the token key
  * file from the classpath (which is why it has no test coverage and the weird nested classes).
@@ -75,10 +77,11 @@ public class ClasspathAwareDefaultSecuri
             //since the Shindig BlobCrypterSecurityTokenDecoder only supports loading directly
from the filesystem...
             if (BlobCrypterSecurityTokenCodec.SECURITY_TOKEN_KEY_FILE.equalsIgnoreCase(name)
&& value != null
                     && value.startsWith(RESOURCE_PREFIX)) {
-                String resourceName = value.substring(RESOURCE_PREFIX.length());
-                URL resource = this.getClass().getClassLoader().getResource(resourceName);
+                final String resourceName = value.substring(RESOURCE_PREFIX.length());
+                final URL resource = this.getClass().getClassLoader().getResource(resourceName);
                 if (resource != null) {
-                    value = resource.getFile();
+                    final URI resourceUri = URI.create(resource.getFile());
+                    value = resourceUri.getPath();
                 }
             }
 



Mime
View raw message