public static class UIImage.UIFileResource extends com.vaadin.server.StreamResource implements ResourceDownloadHandler
| Constructor and Description |
|---|
UIFileResource(Variant.RecordVariant file,
UIImage owner)
Full constructor.
|
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.server.DownloadStream |
getStream() |
boolean |
handleResourceDownload(com.vaadin.server.VaadinRequest req,
com.vaadin.server.VaadinResponse resp)
Writes the resource content to the response object.
|
equals, getBufferSize, getCacheTime, getFilename, getMIMEType, getStreamSource, hashCode, setBufferSize, setCacheTime, setFilename, setMIMEType, setStreamSourcepublic UIFileResource(Variant.RecordVariant file, UIImage owner)
file - the file provider, not null. The file contents is provided by the UIFieldNames.CONTENT property of type BinaryHolderowner - public com.vaadin.server.DownloadStream getStream()
getStream in interface com.vaadin.server.ConnectorResourcegetStream in class com.vaadin.server.StreamResourcepublic boolean handleResourceDownload(com.vaadin.server.VaadinRequest req,
com.vaadin.server.VaadinResponse resp)
throws IOException
handleConnectorRequest(VaadinRequest, VaadinResponse, String)
when UIFileResource is used so that the request returns 404 error instead
of server error.
DO *not* call with Vaadin session lock - blocks until the file is downloaded by the client.handleResourceDownload in interface ResourceDownloadHandlerreq - resp - IOExceptionCopyright © 2007-2018 Whitestein Technologies. All Rights Reserved.