com.vaadin.ui.Upload.interruptUpload()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中com.vaadin.ui.Upload.interruptUpload()方法的一些代码示例,展示了Upload.interruptUpload()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Upload.interruptUpload()方法的具体详情如下:
包路径:com.vaadin.ui.Upload
类名称:Upload
方法名:interruptUpload

Upload.interruptUpload介绍

[英]Interrupts the upload currently being received. The interruption will be done by the receiving thread so this method will return immediately and the actual interrupt will happen a bit later.
[中]中断当前正在接收的上载。中断将由接收线程完成,因此此方法将立即返回,实际中断将在稍后发生。

代码示例

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

public void buttonClick(ClickEvent event) {
    upload.interruptUpload();
  }
});

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

@Override
public void interruptUpload() {
  super.interruptUpload();
  uploadInterrupted = true;
}

代码示例来源:origin: eclipse/hawkbit

@Override
public void interruptUpload() {
  super.interruptUpload();
  uploadInterrupted = true;
}

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

public void buttonClick(ClickEvent event) {
    upload.interruptUpload();
  }
});

代码示例来源:origin: org.activiti/activiti-explorer

protected void interrupt() {
 upload.interruptUpload();
 interrupted = true;
}

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

public void buttonClick(Button.ClickEvent event) {
    upload.interruptUpload();
  }
});

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

public void buttonClick(Button.ClickEvent event) {
    upload.interruptUpload();
  }
});

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

public void buttonClick(ClickEvent event) {
    upload.interruptUpload();
  }
});

代码示例来源:origin: org.aperteworkflow/base-widgets

public void buttonClick(ClickEvent event) {
    uploadFile.interruptUpload();
  }
});

代码示例来源:origin: org.aperteworkflow/gui-commons

@Override
public OutputStream receiveUpload(String filename, String mimeType) {
  out = null;
  I18NSource message = I18NSource.ThreadUtil.getThreadI18nSource();
  if (!allowedMimeTypes.isEmpty() && !allowedMimeTypes.contains(mimeType)) {
    logger.log(Level.INFO, "Disallowed mimeType " + mimeType);
    setUploadFailedNotification(message.getMessage("uploader.mimeType.disallowed", new Object[] { mimeType }));
  } else {
    try {
      out = createOutputStream();
    } catch (Exception e) {
      logger.log(Level.SEVERE, "Failed to create output stream", e);
      setUploadFailedNotification(message.getMessage("uploader.out.failed"));
    }
  }
  
  if (out == null) {
    // No valid output, interrupt and return fake
    upload.interruptUpload();
    return nullOut;
  } else {
    return out;
  }
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

@Override
public void uploadStarted(final StartedEvent event) {
  if (!event.getFilename().endsWith(".csv")) {
    new HawkbitErrorNotificationMessage(SPUIStyleDefinitions.SP_NOTIFICATION_ERROR_MESSAGE_STYLE, null,
        i18n.getMessage("bulk.targets.upload"), true).show(Page.getCurrent());
    LOG.error("Wrong file format for file {}", event.getFilename());
    upload.interruptUpload();
  } else {
    eventBus.publish(this, new TargetTableEvent(TargetComponentEvent.BULK_TARGET_UPLOAD_STARTED));
  }
}

代码示例来源:origin: eclipse/hawkbit

@Override
public void uploadStarted(final StartedEvent event) {
  if (!event.getFilename().endsWith(".csv")) {
    new HawkbitErrorNotificationMessage(SPUIStyleDefinitions.SP_NOTIFICATION_ERROR_MESSAGE_STYLE, null,
        i18n.getMessage("bulk.targets.upload"), true).show(Page.getCurrent());
    LOG.error("Wrong file format for file {}", event.getFilename());
    upload.interruptUpload();
  } else {
    eventBus.publish(this, new TargetTableEvent(TargetComponentEvent.BULK_TARGET_UPLOAD_STARTED));
  }
}

代码示例来源:origin: org.aperteworkflow/gui-commons

@Override
public void updateProgress(long readBytes, long contentLength) {
  if (uploadFailedNotification != null) {
    // dirty way to check if we failed to start the upload
    // can not return null from receiveUpload because it causes an ugly error indicator
    // so we do this here, otherwise error in receiveUpload can be swallowed
    return;
  }
  
  if (maxFileSize > 0 && (maxFileSize < readBytes || (contentLength != -1 && maxFileSize < contentLength))) {
    I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
    setUploadFailedNotification(messages.getMessage("uploader.size.exceeded"));
    upload.interruptUpload();
  }
  float progress = ((float) readBytes) / ((float) contentLength);
  if (progress > 1) {
    progress = 1;
  }
  progressIndicator.setValue(progress);
  //progressIndicator.setCaption(readableIn + " / " + readableAll);
}

代码示例来源:origin: eclipse/hawkbit

event.getUpload().interruptUpload();
} else {
  LOG.info("Uploading file {}", fileUploadId);
        fileUploadId);
    interruptUploadDueToIllegalFilename();
    event.getUpload().interruptUpload();
  }else if (isFileAlreadyContainedInSoftwareModule(fileUploadId, softwareModule)) {
    LOG.info("File {} already contained in Software Module {}", fileUploadId.getFilename(), softwareModule);
    interruptUploadDueToDuplicateFile();
    event.getUpload().interruptUpload();

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

event.getUpload().interruptUpload();
} else {
  LOG.info("Uploading file {}", fileUploadId);
        new FileUploadProgress(fileUploadId, FileUploadStatus.UPLOAD_FAILED));
    setDuplicateFile();
    event.getUpload().interruptUpload();

相关文章