\r
sendStickyBroadcast(true, null); // message to signal the start to the UI\r
\r
- PropFindMethod query;\r
+ PropFindMethod query = null;\r
try {\r
mCurrentSyncTime = System.currentTimeMillis();\r
query = new PropFindMethod(getUri().toString() + "/");\r
// TODO update syncResult\r
Log.e(TAG, "problem while synchronizing owncloud account " + account.name, t);\r
t.printStackTrace();\r
+ \r
+ } finally {\r
+ if (query != null)\r
+ query.releaseConnection(); // let the connection available for other methods\r
}\r
\r
/* Commented code for ugly performance tests\r
}\r
\r
private void fetchData(String uri, SyncResult syncResult, long parentId) {\r
+ PropFindMethod query = null;\r
try {\r
Log.d(TAG, "fetching " + uri);\r
\r
// remote request \r
- PropFindMethod query = new PropFindMethod(uri);\r
+ query = new PropFindMethod(uri);\r
/* Commented code for ugly performance tests\r
long responseDelay = System.currentTimeMillis();\r
*/\r
Vector<OCFile> files = getStorageManager().getDirectoryContent(\r
getStorageManager().getFileById(parentId));\r
OCFile file;\r
+ String currentSavePath = FileDownloader.getSavePath(mAccount.name);\r
for (int i=0; i < files.size(); ) {\r
file = files.get(i);\r
if (file.getLastSyncDate() != mCurrentSyncTime) {\r
Log.v(TAG, "removing file: " + file);\r
- getStorageManager().removeFile(file);\r
+ getStorageManager().removeFile(file, (file.isDown() && file.getStoragePath().startsWith(currentSavePath)));\r
files.remove(i);\r
} else {\r
i++;\r
if (mDelaysIndex >= MAX_DELAYS)\r
mDelaysIndex = 0;\r
*/\r
- \r
-\r
\r
} catch (OperationCanceledException e) {\r
e.printStackTrace();\r
// TODO update syncResult\r
Log.e(TAG, "problem while synchronizing owncloud account " + mAccount.name, t);\r
t.printStackTrace();\r
+ \r
+ } finally {\r
+ if (query != null)\r
+ query.releaseConnection(); // let the connection available for other methods\r
}\r
}\r
\r