de.laures.cewolf.storage
Class FileStorage

java.lang.Object
  extended by de.laures.cewolf.storage.FileStorage
All Implemented Interfaces:
Storage, java.io.Serializable

public class FileStorage
extends java.lang.Object
implements Storage

Storage for storing images as files in the web application directory as files _chart-XXXXX. Note that by default the files won't ever be removed. To remove saved images on VM exit set the FileStorage.deleteOnExit configuration parameter to "true". For example:

                
                        storage
                        de.laures.cewolf.storage.FileStorage
                
                
                                FileStorage.deleteOnExit
                                true
                 
        

Author:
guido
See Also:
Serialized Form

Constructor Summary
FileStorage()
           
 
Method Summary
 boolean contains(ChartImage chartImage, javax.servlet.jsp.PageContext pageContext)
          see de.laures.cewolf.Storage#contains(ChartImage, PageContext)
 ChartImage getChartImage(java.lang.String id, javax.servlet.http.HttpServletRequest request)
          Retrieves a chart image.
 java.lang.String getKey(ChartImage chartImage)
          see de.laures.cewolf.Storage#getKey(ChartImage)
 void init(javax.servlet.ServletContext servletContext)
          Method init.
 java.lang.String removeChartImage(java.lang.String imgKey, javax.servlet.http.HttpServletRequest pageContext)
          Removes the image from the storage
 java.lang.String storeChartImage(ChartImage cid, javax.servlet.jsp.PageContext pageContext)
          Stores a chart image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileStorage

public FileStorage()
Method Detail

storeChartImage

public java.lang.String storeChartImage(ChartImage cid,
                                        javax.servlet.jsp.PageContext pageContext)
Description copied from interface: Storage
Stores a chart image.

Specified by:
storeChartImage in interface Storage
Parameters:
cid - the image to be stored
pageContext - servletContext which might be needed
Returns:
String the storage id which is used to find the image in storage
See Also:
Storage.storeChartImage(ChartImage, PageContext)

getChartImage

public ChartImage getChartImage(java.lang.String id,
                                javax.servlet.http.HttpServletRequest request)
Description copied from interface: Storage
Retrieves a chart image.

Specified by:
getChartImage in interface Storage
Parameters:
id - the id of the image
request - the request
Returns:
ChartImage the stored image instance
See Also:
Storage.getChartImage(String, HttpServletRequest)

contains

public boolean contains(ChartImage chartImage,
                        javax.servlet.jsp.PageContext pageContext)
see de.laures.cewolf.Storage#contains(ChartImage, PageContext)


getKey

public java.lang.String getKey(ChartImage chartImage)
see de.laures.cewolf.Storage#getKey(ChartImage)


init

public void init(javax.servlet.ServletContext servletContext)
          throws CewolfException
Description copied from interface: Storage
Method init.

Specified by:
init in interface Storage
Throws:
CewolfException
See Also:
Storage.init(ServletContext)

removeChartImage

public java.lang.String removeChartImage(java.lang.String imgKey,
                                         javax.servlet.http.HttpServletRequest pageContext)
                                  throws CewolfException
Description copied from interface: Storage
Removes the image from the storage

Specified by:
removeChartImage in interface Storage
Parameters:
imgKey - Image id
pageContext - Servlet request
Returns:
Image id
Throws:
CewolfException
See Also:
Storage.removeChartImage(java.lang.String, javax.servlet.http.HttpServletRequest)


cewolf tag library - web charts with JFreeChart