From c9dc5f3c36a09b75a016cd0aea50b873f4befe43 Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Mon, 5 Jul 2010 06:46:05 +0000 Subject: [PATCH] #5300 add default constructor for the Upload component svn changeset:14056/svn branch:6.4 --- src/com/vaadin/ui/Upload.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/com/vaadin/ui/Upload.java b/src/com/vaadin/ui/Upload.java index a15495fbc7..60c31fbc67 100644 --- a/src/com/vaadin/ui/Upload.java +++ b/src/com/vaadin/ui/Upload.java @@ -107,6 +107,14 @@ public class Upload extends AbstractComponent implements Component.Focusable { /* TODO: Add a default constructor, receive to temp file. */ + /** + * Creates a new instance of Upload. + * + * The receiver must be set before performing an upload. + */ + public Upload() { + } + /** * Creates a new instance of Upload that redirects the uploaded data to * stream given by the Receiver. @@ -131,6 +139,11 @@ public class Upload extends AbstractComponent implements Component.Focusable { * @param upload */ public void receiveUpload(UploadStream upload) throws UploadException { + if (receiver == null) { + throw new IllegalStateException( + "Receiver not set for the Upload component"); + } + if (!isUploading) { throw new IllegalStateException("uploading not started"); } -- 2.39.5