summaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/main/java/com/vaadin/ui/Upload.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Upload.java b/server/src/main/java/com/vaadin/ui/Upload.java
index 7f5727f078..0e64654d38 100644
--- a/server/src/main/java/com/vaadin/ui/Upload.java
+++ b/server/src/main/java/com/vaadin/ui/Upload.java
@@ -1198,4 +1198,35 @@ public class Upload extends AbstractComponent
protected UploadState getState(boolean markAsDirty) {
return (UploadState) super.getState(markAsDirty);
}
+
+ /**
+ * Returns the component's list of accepted content-types. According to RFC
+ * 1867, the attributeis present, the browser might constrain the file
+ * patterns prompted for to match those with the corresponding appropriate
+ * file extensions for the platform.
+ *
+ * @return comma-separated list of desired mime types to be uploaded
+ * @see #setAcceptMimeTypes
+ * @since
+ */
+ public String getAcceptMimeTypes() {
+ return getState(false).acceptMimeTypes;
+ }
+
+ /**
+ * Sets the component's list of accepted content-types. According to RFC
+ * 1867, the attributeis present, the browser might constrain the file
+ * patterns prompted for to match those with the corresponding appropriate
+ * file extensions for the platform. Good examples are: {@code image/*} or
+ * {@code image/png,text/plain}
+ *
+ * @param acceptMimeTypes
+ * comma-separated list of desired mime types to be uploaded
+ * @see #getAcceptMimeTypes
+ * @since
+ */
+ public void setAcceptMimeTypes(String acceptMimeTypes) {
+ getState().acceptMimeTypes = acceptMimeTypes;
+ }
+
}