From: Henri Sara Date: Mon, 5 Jul 2010 06:46:05 +0000 (+0000) Subject: #5300 add default constructor for the Upload component X-Git-Tag: 6.7.0.beta1~1438 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c9dc5f3c36a09b75a016cd0aea50b873f4befe43;p=vaadin-framework.git #5300 add default constructor for the Upload component svn changeset:14056/svn branch:6.4 --- 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"); }