コード例 #1
0
 protected void checkFileSize(long receivedLength) {
   if (receivedLength > maxFileSize) {
     interrupt();
     notificationManager.showWarningNotification(
         Messages.UPLOAD_FAILED, Messages.UPLOAD_LIMIT, maxFileSize / 1024 + "kb");
   }
 }
コード例 #2
0
 protected void checkMimeType(String mimeType) {
   if (acceptedMimeTypes != null && !acceptedMimeTypes.contains(mimeType)) {
     interrupt();
     notificationManager.showWarningNotification(
         Messages.UPLOAD_FAILED,
         Messages.UPLOAD_INVALID_MIMETYPE,
         StringUtil.toReadableString(acceptedMimeTypes));
   }
 }