Merge pull request #366 from owncloud/bug_handling_failure_in_request_for_remote_username
[pub/Android/ownCloud.git] / src / com / owncloud / android / files / services / FileUploader.java
index a55ce8c..9575a33 100644 (file)
@@ -605,7 +605,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
         ReadRemoteFileOperation operation = new ReadRemoteFileOperation(mCurrentUpload.getRemotePath());
         RemoteOperationResult result = operation.execute(mUploadClient);
         if (result.isSuccess()) {
-            updateOCFile(file, result.getData().get(0));
+            updateOCFile(file, (RemoteFile)result.getData().get(0));
             file.setLastSyncDateForProperties(syncDate);
         }
         
@@ -705,7 +705,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
         int percent = (int) (100.0 * ((double) totalTransferredSoFar) / ((double) totalToTransfer));
         if (percent != mLastPercent) {
             mNotification.contentView.setProgressBar(R.id.status_progress, 100, percent, false);
-            String fileName = filePath.substring(filePath.lastIndexOf(FileUtils.PATH_SEPARATOR + 1));
+            String fileName = filePath.substring(filePath.lastIndexOf(FileUtils.PATH_SEPARATOR) + 1);
             String text = String.format(getString(R.string.uploader_upload_in_progress_content), percent, fileName);
             mNotification.contentView.setTextViewText(R.id.status_text, text);
             mNotificationManager.notify(R.string.uploader_upload_in_progress_ticker, mNotification);