|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jfree.chart.servlet.ServletUtilities
Utility class used for servlet related JFreeChart operations.
Constructor Summary | |
ServletUtilities()
|
Method Summary | |
protected static void |
createTempDir()
Creates the temporary directory if it does not exist. |
protected static void |
registerChartForDeletion(java.io.File tempFile,
javax.servlet.http.HttpSession session)
Adds a ChartDeleter object to the session object with the name JFreeChart_Deleter if there is not already one bound to the session and adds the filename to the list of charts to be deleted. |
static java.lang.String |
saveChartAsJPEG(JFreeChart chart,
int width,
int height,
ChartRenderingInfo info,
javax.servlet.http.HttpSession session)
Saves the chart as a JPEG format file in the temporary directory and populates the ChartRenderingInfo object which can be used to generate an HTML image map. |
static java.lang.String |
saveChartAsJPEG(JFreeChart chart,
int width,
int height,
javax.servlet.http.HttpSession session)
Saves the chart as a JPEG format file in the temporary directory. |
static java.lang.String |
saveChartAsPNG(JFreeChart chart,
int width,
int height,
ChartRenderingInfo info,
javax.servlet.http.HttpSession session)
Saves the chart as a PNG format file in the temporary directory and populates the ChartRenderingInfo object which can be used to generate an HTML image map. |
static java.lang.String |
saveChartAsPNG(JFreeChart chart,
int width,
int height,
javax.servlet.http.HttpSession session)
Saves the chart as a PNG format file in the temporary directory. |
static java.lang.String |
searchReplace(java.lang.String inputString,
java.lang.String searchString,
java.lang.String replaceString)
Perform a search/replace operation on a String There are String methods to do this since (JDK 1.4) |
static void |
sendTempFile(java.io.File file,
javax.servlet.http.HttpServletResponse response)
Binary streams the specified file to the HTTP response in 1KB chunks |
static void |
sendTempFile(java.io.File file,
javax.servlet.http.HttpServletResponse response,
java.lang.String mimeType)
Binary streams the specified file to the HTTP response in 1KB chunks |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ServletUtilities()
Method Detail |
public static java.lang.String saveChartAsPNG(JFreeChart chart, int width, int height, javax.servlet.http.HttpSession session) throws java.io.IOException
chart
- the JFreeChart to be saved.width
- the width of the chart.height
- the height of the chart.session
- the HttpSession of the client.
java.io.IOException
- if there is a problem saving the file.public static java.lang.String saveChartAsPNG(JFreeChart chart, int width, int height, ChartRenderingInfo info, javax.servlet.http.HttpSession session) throws java.io.IOException
chart
- the JFreeChart to be saved.width
- the width of the chart.height
- the height of the chart.info
- the ChartRenderingInfo object to be populated.session
- the HttpSession of the client.
java.io.IOException
- if there is a problem saving the file.public static java.lang.String saveChartAsJPEG(JFreeChart chart, int width, int height, javax.servlet.http.HttpSession session) throws java.io.IOException
chart
- the JFreeChart to be saved.width
- the width of the chart.height
- the height of the chart.session
- the HttpSession of the client.
java.io.IOException
- if there is a problem saving the file.public static java.lang.String saveChartAsJPEG(JFreeChart chart, int width, int height, ChartRenderingInfo info, javax.servlet.http.HttpSession session) throws java.io.IOException
chart
- the JFreeChart to be savedwidth
- the width of the chartheight
- the height of the chartinfo
- the ChartRenderingInfo object to be populatedsession
- the HttpSession of the client
java.io.IOException
- if there is a problem saving the file.protected static void createTempDir()
protected static void registerChartForDeletion(java.io.File tempFile, javax.servlet.http.HttpSession session)
tempFile
- the file to be deleted.session
- the HTTP session of the client.public static void sendTempFile(java.io.File file, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, java.io.FileNotFoundException
file
- The file to be streamed.response
- The HTTP response object.
java.io.IOException
- if there is an I/O problem.
java.io.FileNotFoundException
- if the file is not found.public static void sendTempFile(java.io.File file, javax.servlet.http.HttpServletResponse response, java.lang.String mimeType) throws java.io.IOException, java.io.FileNotFoundException
file
- The file to be streamed.response
- The HTTP response object.mimeType
- The mime type of the file, null allowed.
java.io.IOException
- if there is an I/O problem.
java.io.FileNotFoundException
- if the file is not found.public static java.lang.String searchReplace(java.lang.String inputString, java.lang.String searchString, java.lang.String replaceString)
inputString
- the String to have the search/replace operation.searchString
- the search String.replaceString
- the replace String.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |