Fixed local database incoherence when files whit special characters in their name...
authorDavid A. Velasco <dvelasco@solidgear.es>
Fri, 22 Jun 2012 13:14:13 +0000 (15:14 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Fri, 22 Jun 2012 13:14:13 +0000 (15:14 +0200)
AndroidManifest.xml
src/eu/alefzero/owncloud/files/services/FileUploader.java

index 52f8e67..c8e9692 100644 (file)
@@ -18,7 +18,7 @@
  -->\r
 <manifest package="eu.alefzero.owncloud"\r
     android:versionCode="1"\r
-    android:versionName="0.1.128B" xmlns:android="http://schemas.android.com/apk/res/android">\r
+    android:versionName="0.1.129B" xmlns:android="http://schemas.android.com/apk/res/android">\r
 \r
     <uses-permission android:name="android.permission.GET_ACCOUNTS" />\r
     <uses-permission android:name="android.permission.USE_CREDENTIALS" />\r
index a55675d..c34e79c 100644 (file)
@@ -176,12 +176,13 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
             mCurrentIndexUpload = i;
             if (wc.putFile(mLocalPaths[i], mRemotePaths[i], mimeType)) {
                 mResult |= true;
-                OCFile new_file = new OCFile(mRemotePaths[i]);
+                String decRemotePath = URLDecoder.decode(mRemotePaths[i]);
+                OCFile new_file = new OCFile(decRemotePath);    // FyleSyncAdapter and this MUST use the same encoding when creating a new OCFile
                 new_file.setMimetype(mimeType);
                 new_file.setFileLength(new File(mLocalPaths[i]).length());
                 new_file.setModificationTimestamp(System.currentTimeMillis());
                 new_file.setLastSyncDate(0);
-                new_file.setStoragePath(mLocalPaths[i]);
+                new_file.setStoragePath(mLocalPaths[i]);         
                 File f = new File(URLDecoder.decode(mRemotePaths[i]));
                 new_file.setParentId(storageManager.getFileByPath(f.getParent().endsWith("/")?f.getParent():f.getParent()+"/").getFileId());
                 storageManager.saveFile(new_file);