Author: reto
Date: Wed Mar 21 16:10:18 2012
New Revision: 1303457

URL: http://svn.apache.org/viewvc?rev=1303457&view=rev
Log:
STANBOL-546: encoding uris before using them as filename

Modified:
    
incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/StoreResource.java

Modified: 
incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/StoreResource.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/StoreResource.java?rev=1303457&r1=1303456&r2=1303457&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/StoreResource.java
 (original)
+++ 
incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/StoreResource.java
 Wed Mar 21 16:10:18 2012
@@ -41,6 +41,7 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLConnection;
+import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -333,7 +334,8 @@ public class StoreResource extends BaseS
             addCORSOrigin(servletContext, response, headers);
             return response.build();
         } else if (type.equals("raw")) {
-            String fileName = contentURI + "-raw";
+               //TODO we should return the content directly without the file 
indirection
+            String fileName = URLEncoder.encode(contentURI, "utf-8") + "-raw";
             File file = new File(fileName);
             if (file.exists()) {
                 file.delete();


Reply via email to