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, setStreamSource
public UIFileResource(Variant.RecordVariant file, UIImage owner)
file
- the file provider, not null. The file contents is provided by the UIFieldNames.CONTENT
property of type BinaryHolder
owner
- public com.vaadin.server.DownloadStream getStream()
getStream
in interface com.vaadin.server.ConnectorResource
getStream
in class com.vaadin.server.StreamResource
public 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 ResourceDownloadHandler
req
- resp
- IOException
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.