You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wink.apache.org by bl...@apache.org on 2009/09/16 19:00:02 UTC

svn commit: r815882 - /incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/utils/FileLoader.java

Author: bluk
Date: Wed Sep 16 17:00:02 2009
New Revision: 815882

URL: http://svn.apache.org/viewvc?rev=815882&view=rev
Log:
Removed decoding from file loading

Thanks Kaloyan Kolev for reporting the issue.

See [WINK-187]

Modified:
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/utils/FileLoader.java

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/utils/FileLoader.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/utils/FileLoader.java?rev=815882&r1=815881&r2=815882&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/utils/FileLoader.java (original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/utils/FileLoader.java Wed Sep 16 17:00:02 2009
@@ -25,7 +25,6 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Enumeration;
@@ -103,18 +102,6 @@
         }
         URL url = resources.nextElement();
         try {
-            // decode any escaped sequences such as <space> which is %20 in URL
-            URI uri = url.toURI();
-            String path = uri.getSchemeSpecificPart();
-            url = new URL(url.getProtocol(), null, path);
-        } catch (IOException e) {
-            logger.error(e.getMessage(), e);
-            throw new FileNotFoundException(fileName);
-        } catch (URISyntaxException e) {
-            // do nothing, but return the real (!) url
-        }
-
-        try {
             return url.openStream();
         } catch (IOException e) {
             logger.error(e.getMessage(), e);
@@ -127,7 +114,7 @@
      * 
      * @param filename
      * @return
-     * @throws IOException 
+     * @throws IOException
      */
     public static Enumeration<URL> loadFileUsingClassLoaders(String filename) throws IOException {
         logger.debug("Searching for {} using thread context classloader.", filename);
@@ -148,7 +135,8 @@
         return ClassLoader.getSystemResources(filename);
     }
 
-    private static Enumeration<URL> loadFileUsingClassLoader(ClassLoader classLoader, String filename) throws IOException {
+    private static Enumeration<URL> loadFileUsingClassLoader(ClassLoader classLoader,
+                                                             String filename) throws IOException {
         Enumeration<URL> resources = null;
         if (classLoader != null) {
             resources = classLoader.getResources(filename);