cached instant upload
[pub/Android/ownCloud.git] / src / eu / alefzero / owncloud / files / services / FileDownloader.java
index 087b103..ed865b7 100644 (file)
@@ -1,6 +1,7 @@
 package eu.alefzero.owncloud.files.services;\r
 \r
 import java.io.File;\r
+import java.io.IOException;\r
 \r
 import android.accounts.Account;\r
 import android.accounts.AccountManager;\r
@@ -127,9 +128,13 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
         mNotificationMngr.notify(1, mNotification);\r
 \r
         File sdCard = Environment.getExternalStorageDirectory();\r
-        File dir = new File(sdCard.getAbsolutePath() + "/owncloud");\r
-        dir.mkdirs();\r
-        File file = new File(dir, mFilePath.replace('/', '.'));\r
+        File file = new File(sdCard.getAbsolutePath() + "/owncloud/" + mAccount.name + mFilePath);\r
+        try {\r
+            file.getParentFile().mkdirs();\r
+            file.createNewFile();\r
+        } catch (IOException e) {\r
+            e.printStackTrace();\r
+        }\r
 \r
         Log.e(TAG, file.getAbsolutePath() + " " + oc_url.toString());\r
         Log.e(TAG, mFilePath+"");\r