incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From enor...@apache.org
Subject svn commit: r1150196 - /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/FileDataStore.java
Date Sat, 23 Jul 2011 19:24:15 GMT
Author: enorman
Date: Sat Jul 23 19:24:14 2011
New Revision: 1150196

URL: http://svn.apache.org/viewvc?rev=1150196&view=rev
Log:
SLING-2131 handle special characters in the generated filename that are not allowed by windows

Modified:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/FileDataStore.java

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/FileDataStore.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/FileDataStore.java?rev=1150196&r1=1150195&r2=1150196&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/FileDataStore.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/FileDataStore.java
Sat Jul 23 19:24:14 2011
@@ -148,7 +148,11 @@ public class FileDataStore {
         final int pos = url.lastIndexOf('/');
         final String name = url.substring(pos + 1);
         final String filename = (hint == null ? "rsrc" : hint) + '-' + name + '-' + getNextSerialNumber()
+ ".ser";
-        final File file = this.getDataFile(filename);
+        
+        //replace special characters from the filename that are not allowed by the OS
+        final String filename2 = filename.replaceAll("[\\*\"/\\\\\\[\\]\\:\\;\\|\\=\\,]+",
"_"); // Windows
+      
+        final File file = this.getDataFile(filename2);
 
         this.copyToLocalStorage(stream, file);
 



Mime
View raw message