org.glassfish.admingui.common.servlet
Class LogFilesContentSource

java.lang.Object
  extended by org.glassfish.admingui.common.servlet.LogFilesContentSource
All Implemented Interfaces:
DownloadServlet.ContentSource

public class LogFilesContentSource
extends Object
implements DownloadServlet.ContentSource

Author:
andriy.zhdanov

Constructor Summary
LogFilesContentSource()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogFilesContentSource

public LogFilesContentSource()
Method Detail

getId

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.

Specified by:
getId in interface DownloadServlet.ContentSource

getInputStream

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.

Specified by:
getInputStream in interface DownloadServlet.ContentSource

cleanUp

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.

Specified by:
cleanUp in interface DownloadServlet.ContentSource

getLastModified

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.

Specified by:
getLastModified in interface DownloadServlet.ContentSource
Returns:
-1


Copyright © 2012. All Rights Reserved.