+ \r
+ // removal of old files\r
+ // TODO - getDirectoryContent is crashing the app by lack of memory when a lot of files are in the same directory!!!!\r
+ // tested with the path /\r
+ if (logmore) Log.v(TAG, "syncing: fetching many-files, RETRIEVING VECTOR OF FILES");\r
+ Vector<OCFile> files = getStorageManager().getDirectoryContent(\r
+ getStorageManager().getFileById(parentId));\r
+ for (OCFile file : files) {\r
+ if (file.getLastSyncDate() != mCurrentSyncTime && file.getLastSyncDate() != 0)\r
+ getStorageManager().removeFile(file);\r
+ }\r
+ \r
+ // synched folder -> notice to IU\r
+ if (logmore) Log.v(TAG, "syncing: fetching many-files, NOTIFYING THE UI");\r
+ sendStickyBroadcast(true, parentId);\r
+\r
+ // recursive fetch\r
+ if (logmore) Log.v(TAG, "syncing: fetching many-files, TRYING TO RECURSE");\r
+ files = getStorageManager().getDirectoryContent(getStorageManager().getFileById(parentId));\r
+ for (OCFile file : files) {\r
+ if (file.getMimetype().equals("DIR")) {\r
+ fetchData(getUri().toString() + file.getRemotePath(), syncResult, file.getFileId());\r
+ }\r
+ }\r
+\r
+\r