Beispiel #1
0
 public boolean anyFileIsRepeated(boolean checkOnlyUploadedFiles) {
   if (!multiple && avoidRepeatedFiles) {
     for (String s : fileInput.getFilenames()) {
       if (fileDone.contains(s) || (!checkOnlyUploadedFiles && fileUploading.contains(s)))
         return true;
     }
   }
   return false;
 }
Beispiel #2
0
  /**
   * Called when the uploader detects that the upload process has finished: - in the case of submit
   * complete. - in the case of error talking with the server.
   */
  private void uploadFinished() {
    removeFromQueue();
    finished = true;
    uploading = false;
    updateStatusTimer.cancel();
    statusWidget.setVisible(false);

    if (successful) {
      if (avoidRepeatedFiles) {
        fileDone.addAll(fileInput.getFilenames());
        statusWidget.setStatus(IUploadStatus.Status.SUCCESS);
      } else {
        statusWidget.setStatus(IUploadStatus.Status.SUCCESS);
      }
    } else if (canceled) {
      statusWidget.setStatus(IUploadStatus.Status.CANCELED);
    } else {
      statusWidget.setStatus(IUploadStatus.Status.ERROR);
    }
    onFinishUpload();
    reatachIframe(uploadForm.getElement().getAttribute("target"));
  }
Beispiel #3
0
 /* (non-Javadoc)
  * @see gwtupload.client.IUploader#getFileNames()
  */
 public List<String> getFileNames() {
   return fileInput.getFilenames();
 }