- file = obtainNewOCFileToUpload(remotePaths[i], localPaths[i], ((mimeTypes!=null)?mimeTypes[i]:(String)null), isInstant, forceOverwrite, storageManager);
+ file = storageManager.getFileByLocalPath(remotePaths[i]);
+ if (file != null) {
+ Log.d(TAG, "Upload of file already in server: " + remotePaths[i]);
+ // TODO - review handling of input OCFiles in FileDownloader and FileUploader ; some times retrieving them from database can be necessary, some times not; we should make something consistent
+ } else {
+ Log.d(TAG, "Upload of new file: " + remotePaths[i]);
+ file = obtainNewOCFileToUpload(remotePaths[i], localPaths[i], ((mimeTypes!=null)?mimeTypes[i]:(String)null), isInstant, storageManager);
+ }