X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/d5627b41653ee1549e23116fc6a90a1725d62fba..51302a638677b16c5faac6242da44080794f537e:/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java diff --git a/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java b/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java index 10a8671e..5ae763cc 100644 --- a/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java +++ b/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java @@ -45,6 +45,8 @@ import com.actionbarsherlock.view.MenuItem; import eu.alefzero.owncloud.R; import eu.alefzero.owncloud.authenticator.AccountAuthenticator; import eu.alefzero.owncloud.authenticator.AuthUtils; +import eu.alefzero.owncloud.datamodel.DataStorageManager; +import eu.alefzero.owncloud.datamodel.FileDataStorageManager; import eu.alefzero.owncloud.datamodel.OCFile; import eu.alefzero.owncloud.ui.fragment.FileListFragment; import eu.alefzero.webdav.WebdavClient; @@ -59,6 +61,7 @@ import eu.alefzero.webdav.WebdavClient; public class FileDisplayActivity extends SherlockFragmentActivity implements OnNavigationListener { private ArrayAdapter mDirectories; + private DataStorageManager mStorageManager; private static final int DIALOG_CHOOSE_ACCOUNT = 0; @@ -92,12 +95,15 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements for (int i = mDirectories.getCount() - 2; i >= 0; --i) { path += "/" + mDirectories.getItem(i); } - OCFile parent = new OCFile(getContentResolver(), a, path + "/"); - path += "/" + s + "/"; + OCFile parent = mStorageManager.getFileByPath(path + "/"); + path += s + "/"; Thread thread = new Thread(new DirectoryCreator(path, a)); thread.start(); - OCFile.createNewFile(getContentResolver(), a, path, 0, 0, 0, - "DIR", parent.getFileId()).save(); + + OCFile new_file = new OCFile(path); + new_file.setMimetype("DIR"); + new_file.setParentId(parent.getParentId()); + mStorageManager.saveFile(new_file); dialog.dismiss(); } @@ -118,6 +124,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements R.layout.sherlock_spinner_dropdown_item); mDirectories.add("/"); setContentView(R.layout.files); + mStorageManager = new FileDataStorageManager(AuthUtils.getCurrentOwnCloudAccount(this), getContentResolver()); ActionBar action_bar = getSupportActionBar(); action_bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); action_bar.setDisplayShowTitleEnabled(false); @@ -272,4 +279,4 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements } -} \ No newline at end of file +}