Quick patch to fix operations not ready for HTTPS
[pub/Android/ownCloud.git] / src / eu / alefzero / owncloud / datamodel / FileDataStorageManager.java
index e1b62ef..43af746 100644 (file)
@@ -378,7 +378,7 @@ public class FileDataStorageManager implements DataStorageManager {
                 if (file.getStoragePath() == null) {
                     // try to find existing file and bind it with current account
                     File sdCard = Environment.getExternalStorageDirectory();
                 if (file.getStoragePath() == null) {
                     // try to find existing file and bind it with current account
                     File sdCard = Environment.getExternalStorageDirectory();
-                    File f = new File(sdCard.getAbsolutePath() + "/owncloud/" + mAccount.name + file.getURLDecodedRemotePath());
+                    File f = new File(sdCard.getAbsolutePath() + "/owncloud/" + mAccount.name + file.getRemotePath());
                     if (f.exists())
                         file.setStoragePath(f.getAbsolutePath());
                 }
                     if (f.exists())
                         file.setStoragePath(f.getAbsolutePath());
                 }
@@ -412,7 +412,7 @@ public class FileDataStorageManager implements DataStorageManager {
                                         ProviderTableMeta.FILE_ACCOUNT_OWNER+"=?",
                                         new String[]{mAccount.name});
         }
                                         ProviderTableMeta.FILE_ACCOUNT_OWNER+"=?",
                                         new String[]{mAccount.name});
         }
-        if (file.getStoragePath() != null) {
+        if (file.isDown()) {
             new File(file.getStoragePath()).delete();
         }
     }
             new File(file.getStoragePath()).delete();
         }
     }