private void setUpUploadingAgain(PictureFile failedFile) {

    if (failedFile != null) {
      String filename = failedFile.getFilename();
      if (Constants.DEBUG) {
        ToastHelper.showToast(getApplicationContext(), "FAILED " + failedFile.getFilename());
      }
      Log.w(LOG_TAG, "FAILED " + filename);
      failedFile.setStatus(DAOHelper.FILE_STATUS_IN_QUEUE);
      daoHelper.pictureFileDao.update(failedFile);
      daoHelper.onPictureFilesUpdated();
    }
  }
  private void onUploadInProgress(PictureFile uploadingFile) {

    if (uploadingFile != null) {
      Integer oldStatus = uploadingFile.getStatus();
      if (oldStatus != DAOHelper.FILE_STATUS_UPLOADING
          && oldStatus != DAOHelper.FILE_STATUS_UPLOADED) {
        Log.w(LOG_TAG, "IN PROGRESS " + uploadingFile.getFilename());
        uploadingFile.setStatus(DAOHelper.FILE_STATUS_UPLOADING);
        daoHelper.pictureFileDao.update(uploadingFile);
        daoHelper.onPictureFilesUpdated();
      }
    }
  }
  private void onUploadCompleted(PictureFile uploadedFile) {

    if (uploadedFile != null) {
      if (Constants.DEBUG) {
        ToastHelper.showToast(getApplicationContext(), "COMPLETED " + uploadedFile.getFilename());
      }
      Log.w(LOG_TAG, "COMPLETED " + uploadedFile.getFilename());
      uploadedFile.setStatus(DAOHelper.FILE_STATUS_UPLOADED);
      uploadedFile.setIsDeleted(false);
      daoHelper.pictureFileDao.update(uploadedFile);
      daoHelper.onPictureFilesUpdated();
    }

    uploadCycleFinished();
  }