Java Doc for ServletUtilities.java in  » Chart » jfreechart » org » jfree » chart » servlet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Chart » jfreechart » org.jfree.chart.servlet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jfree.chart.servlet.ServletUtilities

ServletUtilities
public class ServletUtilities (Code)
Utility class used for servlet related JFreeChart operations.




Method Summary
protected static  voidcreateTempDir()
     Creates the temporary directory if it does not exist.
public static  StringgetTempFilePrefix()
     Returns the prefix for the temporary file names generated by this class.
public static  StringgetTempOneTimeFilePrefix()
     Returns the prefix for "one time" temporary file names generated by this class.
protected static  voidregisterChartForDeletion(File tempFile, 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.
public static  StringsaveChartAsJPEG(JFreeChart chart, int width, int height, HttpSession session)
     Saves the chart as a JPEG format file in the temporary directory.

SPECIAL NOTE: Please avoid using JPEG as an image format for charts, it is a "lossy" format that introduces visible distortions in the resulting image - use PNG instead.

public static  StringsaveChartAsJPEG(JFreeChart chart, int width, int height, ChartRenderingInfo info, 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.

SPECIAL NOTE: Please avoid using JPEG as an image format for charts, it is a "lossy" format that introduces visible distortions in the resulting image - use PNG instead.

public static  StringsaveChartAsPNG(JFreeChart chart, int width, int height, HttpSession session)
     Saves the chart as a PNG format file in the temporary directory.
Parameters:
  chart - the JFreeChart to be saved.
Parameters:
  width - the width of the chart.
Parameters:
  height - the height of the chart.
Parameters:
  session - the HttpSession of the client (if null, thetemporary file is marked as "one-time" and deleted by the DisplayChart servlet right after it isstreamed to the client).
public static  StringsaveChartAsPNG(JFreeChart chart, int width, int height, ChartRenderingInfo info, 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.
Parameters:
  chart - the chart to be saved (null not permitted).
Parameters:
  width - the width of the chart.
Parameters:
  height - the height of the chart.
Parameters:
  info - the ChartRenderingInfo object to be populated (null permitted).
Parameters:
  session - the HttpSession of the client (if null, thetemporary file is marked as "one-time" and deleted by the DisplayChart servlet right after it isstreamed to the client).
public static  StringsearchReplace(String inputString, String searchString, String replaceString)
     Perform a search/replace operation on a String There are String methods to do this since (JDK 1.4)
Parameters:
  inputString - the String to have the search/replace operation.
Parameters:
  searchString - the search String.
Parameters:
  replaceString - the replace String.
public static  voidsendTempFile(String filename, HttpServletResponse response)
     Binary streams the specified file in the temporary directory to the HTTP response in 1KB chunks.
public static  voidsendTempFile(File file, HttpServletResponse response)
     Binary streams the specified file to the HTTP response in 1KB chunks.
public static  voidsendTempFile(File file, HttpServletResponse response, String mimeType)
     Binary streams the specified file to the HTTP response in 1KB chunks.
public static  voidsetTempFilePrefix(String prefix)
     Sets the prefix for the temporary file names generated by this class.
public static  voidsetTempOneTimeFilePrefix(String prefix)
     Sets the prefix for the "one time" temporary file names generated by this class.



Method Detail
createTempDir
protected static void createTempDir()(Code)
Creates the temporary directory if it does not exist. Throws a RuntimeException if the temporary directory is null. Uses the system property java.io.tmpdir as the temporary directory. This sounds like a strange thing to do but my temporary directory was not created on my default Tomcat 4.0.3 installation. Could save some questions on the forum if it is created when not present.



getTempFilePrefix
public static String getTempFilePrefix()(Code)
Returns the prefix for the temporary file names generated by this class. The prefix (never null).



getTempOneTimeFilePrefix
public static String getTempOneTimeFilePrefix()(Code)
Returns the prefix for "one time" temporary file names generated by this class. The prefix.



registerChartForDeletion
protected static void registerChartForDeletion(File tempFile, HttpSession session)(Code)
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.
Parameters:
  tempFile - the file to be deleted.
Parameters:
  session - the HTTP session of the client.



saveChartAsJPEG
public static String saveChartAsJPEG(JFreeChart chart, int width, int height, HttpSession session) throws IOException(Code)
Saves the chart as a JPEG format file in the temporary directory.

SPECIAL NOTE: Please avoid using JPEG as an image format for charts, it is a "lossy" format that introduces visible distortions in the resulting image - use PNG instead. In addition, note that JPEG output is supported by JFreeChart only for JRE 1.4.2 or later.
Parameters:
  chart - the JFreeChart to be saved.
Parameters:
  width - the width of the chart.
Parameters:
  height - the height of the chart.
Parameters:
  session - the HttpSession of the client (if null, thetemporary file is marked as "one-time" and deleted by the DisplayChart servlet right after it isstreamed to the client). The filename of the chart saved in the temporary directory.
throws:
  IOException - if there is a problem saving the file.




saveChartAsJPEG
public static String saveChartAsJPEG(JFreeChart chart, int width, int height, ChartRenderingInfo info, HttpSession session) throws IOException(Code)
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.

SPECIAL NOTE: Please avoid using JPEG as an image format for charts, it is a "lossy" format that introduces visible distortions in the resulting image - use PNG instead. In addition, note that JPEG output is supported by JFreeChart only for JRE 1.4.2 or later.
Parameters:
  chart - the chart to be saved (null not permitted).
Parameters:
  width - the width of the chart
Parameters:
  height - the height of the chart
Parameters:
  info - the ChartRenderingInfo object to be populated
Parameters:
  session - the HttpSession of the client (if null, thetemporary file is marked as "one-time" and deleted by the DisplayChart servlet right after it isstreamed to the client). The filename of the chart saved in the temporary directory
throws:
  IOException - if there is a problem saving the file.




saveChartAsPNG
public static String saveChartAsPNG(JFreeChart chart, int width, int height, HttpSession session) throws IOException(Code)
Saves the chart as a PNG format file in the temporary directory.
Parameters:
  chart - the JFreeChart to be saved.
Parameters:
  width - the width of the chart.
Parameters:
  height - the height of the chart.
Parameters:
  session - the HttpSession of the client (if null, thetemporary file is marked as "one-time" and deleted by the DisplayChart servlet right after it isstreamed to the client). The filename of the chart saved in the temporary directory.
throws:
  IOException - if there is a problem saving the file.



saveChartAsPNG
public static String saveChartAsPNG(JFreeChart chart, int width, int height, ChartRenderingInfo info, HttpSession session) throws IOException(Code)
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.
Parameters:
  chart - the chart to be saved (null not permitted).
Parameters:
  width - the width of the chart.
Parameters:
  height - the height of the chart.
Parameters:
  info - the ChartRenderingInfo object to be populated (null permitted).
Parameters:
  session - the HttpSession of the client (if null, thetemporary file is marked as "one-time" and deleted by the DisplayChart servlet right after it isstreamed to the client). The filename of the chart saved in the temporary directory.
throws:
  IOException - if there is a problem saving the file.



searchReplace
public static String searchReplace(String inputString, String searchString, String replaceString)(Code)
Perform a search/replace operation on a String There are String methods to do this since (JDK 1.4)
Parameters:
  inputString - the String to have the search/replace operation.
Parameters:
  searchString - the search String.
Parameters:
  replaceString - the replace String. The String with the replacements made.



sendTempFile
public static void sendTempFile(String filename, HttpServletResponse response) throws IOException(Code)
Binary streams the specified file in the temporary directory to the HTTP response in 1KB chunks.
Parameters:
  filename - the name of the file in the temporary directory.
Parameters:
  response - the HTTP response object.
throws:
  IOException - if there is an I/O problem.



sendTempFile
public static void sendTempFile(File file, HttpServletResponse response) throws IOException(Code)
Binary streams the specified file to the HTTP response in 1KB chunks.
Parameters:
  file - the file to be streamed.
Parameters:
  response - the HTTP response object.
throws:
  IOException - if there is an I/O problem.



sendTempFile
public static void sendTempFile(File file, HttpServletResponse response, String mimeType) throws IOException(Code)
Binary streams the specified file to the HTTP response in 1KB chunks.
Parameters:
  file - the file to be streamed.
Parameters:
  response - the HTTP response object.
Parameters:
  mimeType - the mime type of the file, null allowed.
throws:
  IOException - if there is an I/O problem.



setTempFilePrefix
public static void setTempFilePrefix(String prefix)(Code)
Sets the prefix for the temporary file names generated by this class.
Parameters:
  prefix - the prefix (null not permitted).



setTempOneTimeFilePrefix
public static void setTempOneTimeFilePrefix(String prefix)(Code)
Sets the prefix for the "one time" temporary file names generated by this class.
Parameters:
  prefix - the prefix (null not permitted).



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.