public class LogFilesContentSource extends Object implements DownloadServlet.ContentSource
Constructor and Description |
---|
LogFilesContentSource() |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp(DownloadServlet.Context ctx)
This method may be used to clean up any temporary resources.
|
String |
getId()
This method returns a unique string used to identify this
DownloadServlet#ContentSource . |
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.
|
public String getId()
This method returns a unique string used to identify this
DownloadServlet#ContentSource
. This string must be
specified in order to select the appropriate
DownloadServlet#ContentSource
when using the
DownloadServlet
.
getId
in interface DownloadServlet.ContentSource
public 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 as DownloadServlet.EXTENSION
or
DownloadServlet.CONTENT_TYPE
.
getInputStream
in interface DownloadServlet.ContentSource
public 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.
cleanUp
in interface DownloadServlet.ContentSource
public 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. This implementation always returns -1.
getLastModified
in interface DownloadServlet.ContentSource
Copyright © 2019. All rights reserved.