Package org.apache.wiki.attachment
Interface DynamicAttachmentProvider
public interface DynamicAttachmentProvider
Provides the data for an attachment. Please note that there will be a strong reference retained for the provider for each Attachment
it provides, so do try to keep the object light. Also, reuse objects if possible.
The Provider needs to be thread-safe.
- Since:
- 2.5.34
-
Method Summary
Modifier and Type Method Description java.io.InputStream
getAttachmentData(Context context, Attachment att)
Returns a stream of data for this attachment.
-
Method Details
-
getAttachmentData
java.io.InputStream getAttachmentData(Context context, Attachment att) throws ProviderException, java.io.IOExceptionReturns a stream of data for this attachment. The stream will be closed by AttachmentServlet.- Parameters:
context
- A Wiki Contextatt
- The Attachment for which the data should be received.- Returns:
- InputStream for the data.
- Throws:
ProviderException
- If something goes wrong internallyjava.io.IOException
- If something goes wrong when reading the data
-