- * Create remote folder for instant uploads if necessary.
- *
- * @param client WebdavClient to the ownCloud server.
- * @param storageManager Interface to the local database caching the data in the server.
- * @return 'True' if the folder exists when the methods finishes.
- */
- private boolean createRemoteFolderForInstantUploads(WebdavClient client, FileDataStorageManager storageManager) {
- boolean result = true;
- OCFile instantUploadDir = storageManager.getFileByPath(InstantUploadBroadcastReceiver.INSTANT_UPLOAD_DIR);
- if (instantUploadDir == null) {
- result = client.createDirectory(InstantUploadBroadcastReceiver.INSTANT_UPLOAD_DIR); // fail could just mean that it already exists, but local database is not synchronized; the upload will be started anyway
- OCFile newDir = new OCFile(InstantUploadBroadcastReceiver.INSTANT_UPLOAD_DIR);
- newDir.setMimetype("DIR");
- newDir.setParentId(storageManager.getFileByPath(OCFile.PATH_SEPARATOR).getFileId());
- storageManager.saveFile(newDir);
- }
- return result;
- }
-
- /**