Package org.dellroad.stuff.vaadin7
Class WritableResource
- java.lang.Object
-
- com.vaadin.server.StreamResource
-
- org.dellroad.stuff.vaadin7.WritableResource
-
- All Implemented Interfaces:
ConnectorResource,Resource,Serializable,WriteCallback
public abstract class WritableResource extends StreamResource implements WriteCallback
Support superclass forStreamResourceimplementations that can be more easily implemented by writing to anOutputStreamthan providing anInputStream.- See Also:
- Vaadin Ticket #5145, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.server.StreamResource
StreamResource.StreamSource
-
-
Field Summary
-
Fields inherited from interface com.vaadin.server.ConnectorResource
CONNECTOR_PATH
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedWritableResource(String filename)Constructor.protectedWritableResource(String filename, String mimeType)Convenience constructor that also sets the MIME type.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract voidwriteTo(OutputStream output)Write the resource contents to the givenOutputStreamand then close it.-
Methods inherited from class com.vaadin.server.StreamResource
equals, getBufferSize, getCacheTime, getFilename, getMIMEType, getStream, getStreamSource, hashCode, setBufferSize, setCacheTime, setFilename, setMIMEType, setStreamSource
-
-
-
-
Constructor Detail
-
WritableResource
protected WritableResource(String filename)
Constructor.- Parameters:
filename- resource file name
-
-
Method Detail
-
writeTo
public abstract void writeTo(OutputStream output) throws IOException
Write the resource contents to the givenOutputStreamand then close it.Note that the
VaadinSessionassociated with this resource will not be locked when this method is invoked.- Specified by:
writeToin interfaceWriteCallback- Parameters:
output- resource output stream- Throws:
IOException- if an I/O error occurs
-
-