From 164417ec61f1b96823e57a518b79caa611aa0f53 Mon Sep 17 00:00:00 2001 From: Bartek Przybylski Date: Sat, 26 May 2012 23:03:46 +0200 Subject: [PATCH] downloading files do account specific dir to avoid disambiguity --- src/eu/alefzero/owncloud/files/services/FileDownloader.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/eu/alefzero/owncloud/files/services/FileDownloader.java b/src/eu/alefzero/owncloud/files/services/FileDownloader.java index 087b103e..a5ee28f8 100644 --- a/src/eu/alefzero/owncloud/files/services/FileDownloader.java +++ b/src/eu/alefzero/owncloud/files/services/FileDownloader.java @@ -1,6 +1,7 @@ package eu.alefzero.owncloud.files.services; import java.io.File; +import java.io.IOException; import android.accounts.Account; import android.accounts.AccountManager; @@ -127,9 +128,12 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis mNotificationMngr.notify(1, mNotification); File sdCard = Environment.getExternalStorageDirectory(); - File dir = new File(sdCard.getAbsolutePath() + "/owncloud"); - dir.mkdirs(); - File file = new File(dir, mFilePath.replace('/', '.')); + File file = new File(sdCard.getAbsolutePath() + "/owncloud/" + mAccount.name + mFilePath); + try { + file.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } Log.e(TAG, file.getAbsolutePath() + " " + oc_url.toString()); Log.e(TAG, mFilePath+""); -- 2.11.0