X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/2ef886af316609c2e4a1fe5f2ee32345a8008e33..e901b609baa4dd5f681e2a5257c9e504997e3377:/src/com/owncloud/android/operations/CreateFolderOperation.java diff --git a/src/com/owncloud/android/operations/CreateFolderOperation.java b/src/com/owncloud/android/operations/CreateFolderOperation.java index b0e7ed9d..4df8b3df 100644 --- a/src/com/owncloud/android/operations/CreateFolderOperation.java +++ b/src/com/owncloud/android/operations/CreateFolderOperation.java @@ -84,21 +84,36 @@ public class CreateFolderOperation extends SyncOperation implements OnRemoteOper } } - /** * Save new directory in local database */ public void saveFolderInDB() { - OCFile newDir = new OCFile(mRemotePath); - newDir.setMimetype("DIR"); - long parentId = getStorageManager().getFileByPath(FileStorageUtils.getParentPath(mRemotePath)).getFileId(); - newDir.setParentId(parentId); - newDir.setModificationTimestamp(System.currentTimeMillis()); - getStorageManager().saveFile(newDir); + if (mCreateFullPath && getStorageManager(). + getFileByPath(FileStorageUtils.getParentPath(mRemotePath)) == null){// When parent + // of remote path + // is not created + String[] subFolders = mRemotePath.split("/"); + String composedRemotePath = "/"; - Log_OC.d(TAG, "Create directory " + mRemotePath + " in Database"); + // For each antecesor folders create them recursively + for (int i=0; i