Interface DownloadServlet.ContentSource
-
- All Known Implementing Classes:
ClientStubsContentSource
,LBConfigContentSource
,LogFilesContentSource
,LogViewerContentSource
- Enclosing class:
- DownloadServlet
public static interface DownloadServlet.ContentSource
Implement this interface to provide an Object that is capable of providing data to
DownloadServlet
.ContentSource
implementations must be thread safe. TheDownloadServlet
will reuse the same instance when 2 requests are made to the same ContentSource type. Instance variables, therefore, should not be used; you may use the context to store local information.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cleanUp(DownloadServlet.Context ctx)
This method may be used to clean up any temporary resources.String
getId()
This method should return a unique string used to identify thisContentSource
.InputStream
getInputStream(DownloadServlet.Context ctx)
This method is responsible for generating the content and returning an InputStream to that content.long
getLastModified(DownloadServlet.Context context)
This method is responsible for returning the last modified date of the content, or -1 if not applicable.
-
-
-
Method Detail
-
getId
String getId()
This method should return a unique string used to identify this
ContentSource
. This string must be specified in order to select the appropriateContentSource
when using theDownloadServlet
.
-
getInputStream
InputStream getInputStream(DownloadServlet.Context ctx)
This method is responsible for generating the content and returning an InputStream to that content. It is also responsible for setting any attribute values in the
DownloadServlet#Context
, such asDownloadServlet.EXTENSION
orDownloadServlet.CONTENT_TYPE
.
-
cleanUp
void cleanUp(DownloadServlet.Context ctx)
This method may be used to clean up any temporary resources. It will be invoked after the
InputStream
has been completely read.
-
getLastModified
long getLastModified(DownloadServlet.Context context)
This method is responsible for returning the last modified date of the content, or -1 if not applicable. This information will be used for caching.
-
-