summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui/Upload.java
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@itmill.com>2010-07-05 06:46:05 +0000
committerHenri Sara <henri.sara@itmill.com>2010-07-05 06:46:05 +0000
commitc9dc5f3c36a09b75a016cd0aea50b873f4befe43 (patch)
tree623fbc336704f8352dfa0559a8173a004b6be7b8 /src/com/vaadin/ui/Upload.java
parent565fe51243d05cf9fb1fa20650a061e735d4c24a (diff)
downloadvaadin-framework-c9dc5f3c36a09b75a016cd0aea50b873f4befe43.tar.gz
vaadin-framework-c9dc5f3c36a09b75a016cd0aea50b873f4befe43.zip
#5300 add default constructor for the Upload component
svn changeset:14056/svn branch:6.4
Diffstat (limited to 'src/com/vaadin/ui/Upload.java')
-rw-r--r--src/com/vaadin/ui/Upload.java13
1 files changed, 13 insertions, 0 deletions
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
@@ -108,6 +108,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");
}