public abstract class WritableResource extends StreamResource implements WriteCallback
StreamResource implementations that can be more easily implemented
by writing to an OutputStream than providing an InputStream.StreamResource.StreamSourceCONNECTOR_PATH| Modifier | Constructor and Description |
|---|---|
protected |
WritableResource(String filename)
Constructor.
|
protected |
WritableResource(String filename,
String mimeType)
Convenience constructor that also sets the MIME type.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
writeTo(OutputStream output)
Write the resource contents to the given
OutputStream and then close it. |
equals, getBufferSize, getCacheTime, getFilename, getMIMEType, getStream, getStreamSource, hashCode, setBufferSize, setCacheTime, setFilename, setMIMEType, setStreamSourceprotected WritableResource(String filename)
filename - resource file namepublic abstract void writeTo(OutputStream output) throws IOException
OutputStream and then close it.
Note that the VaadinSession associated with this resource will not be locked
when this method is invoked.
writeTo in interface WriteCallbackoutput - resource output streamIOException - if an I/O error occursCopyright © 2017. All rights reserved.