X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/24a1111aa117f9d825646c23909e39a0d12f43b8..b55f32112512d162eedcf85c0d65dd1ea6f67a46:/src/eu/alefzero/owncloud/files/services/FileDownloader.java diff --git a/src/eu/alefzero/owncloud/files/services/FileDownloader.java b/src/eu/alefzero/owncloud/files/services/FileDownloader.java index 087b103e..cc13a67f 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,13 @@ 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.getParentFile().mkdirs(); + file.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } Log.e(TAG, file.getAbsolutePath() + " " + oc_url.toString()); Log.e(TAG, mFilePath+""); @@ -147,6 +152,7 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis } mNotificationMngr.cancel(1); Intent end = new Intent(DOWNLOAD_FINISH_MESSAGE); + end.putExtra(EXTRA_FILE_PATH, file.getAbsolutePath()); sendBroadcast(end); }