+ String parentPath = null;
+ if (mFile.getParentId() != FileDataStorageManager.ROOT_PARENT_ID) {
+ parentPath = new File(mFile.getRemotePath()).getParent();
+ parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath : parentPath + OCFile.PATH_SEPARATOR;
+ parentDir = storageManager.getFileByPath(parentPath);
+ moveCount++;
+ } else {
+ parentDir = storageManager.getFileByPath(OCFile.PATH_SEPARATOR); // never returns null; keep the path in root folder
+ }
+ while (parentDir == null) {
+ parentPath = new File(parentPath).getParent();
+ parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath : parentPath + OCFile.PATH_SEPARATOR;
+ parentDir = storageManager.getFileByPath(parentPath);
+ moveCount++;
+ } // exit is granted because storageManager.getFileByPath("/") never returns null