
wicket.contrib.tinymce.image.FileResourceStream Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wicketstuff-tinymce Show documentation
Show all versions of wicketstuff-tinymce Show documentation
Adds support for WYSIWYG editing (using TinyMce) to Wicket
package wicket.contrib.tinymce.image;
import java.io.IOException;
import java.io.InputStream;
import org.apache.wicket.util.resource.AbstractResourceStream;
import org.apache.wicket.util.resource.ResourceStreamNotFoundException;
/**
* Resource stream for images.
*
* @author Michal Letynski
*/
public class FileResourceStream extends AbstractResourceStream
{
private static final long serialVersionUID = 1L;
private String contentType;
private transient InputStream inputStream;
public FileResourceStream(String pContentType, InputStream pInputStream)
{
inputStream = pInputStream;
contentType = pContentType;
}
@Override
public String getContentType()
{
return contentType;
}
/**
* {@inheritDoc}
*/
public InputStream getInputStream() throws ResourceStreamNotFoundException
{
return inputStream;
}
/**
* {@inheritDoc}
*/
public void close() throws IOException
{
if (inputStream != null)
{
inputStream.close();
inputStream = null;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy