ServletUtilities.html 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- NewPage -->
  3. <html lang="en">
  4. <head>
  5. <!-- Generated by javadoc (1.8.0_05) on Thu Jul 31 14:50:41 CEST 2014 -->
  6. <title>ServletUtilities (JFreeChart Class Library (version 1.0.19-fx))</title>
  7. <meta name="date" content="2014-07-31">
  8. <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
  9. <script type="text/javascript" src="../../../../script.js"></script>
  10. </head>
  11. <body>
  12. <script type="text/javascript"><!--
  13. try {
  14. if (location.href.indexOf('is-external=true') == -1) {
  15. parent.document.title="ServletUtilities (JFreeChart Class Library (version 1.0.19-fx))";
  16. }
  17. }
  18. catch(err) {
  19. }
  20. //-->
  21. var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9};
  22. var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]};
  23. var altColor = "altColor";
  24. var rowColor = "rowColor";
  25. var tableTab = "tableTab";
  26. var activeTableTab = "activeTableTab";
  27. </script>
  28. <noscript>
  29. <div>JavaScript is disabled on your browser.</div>
  30. </noscript>
  31. <!-- ========= START OF TOP NAVBAR ======= -->
  32. <div class="topNav"><a name="navbar.top">
  33. <!-- -->
  34. </a>
  35. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  36. <a name="navbar.top.firstrow">
  37. <!-- -->
  38. </a>
  39. <ul class="navList" title="Navigation">
  40. <li><a href="../../../../overview-summary.html">Overview</a></li>
  41. <li><a href="package-summary.html">Package</a></li>
  42. <li class="navBarCell1Rev">Class</li>
  43. <li><a href="class-use/ServletUtilities.html">Use</a></li>
  44. <li><a href="package-tree.html">Tree</a></li>
  45. <li><a href="../../../../deprecated-list.html">Deprecated</a></li>
  46. <li><a href="../../../../index-files/index-1.html">Index</a></li>
  47. <li><a href="../../../../help-doc.html">Help</a></li>
  48. </ul>
  49. </div>
  50. <div class="subNav">
  51. <ul class="navList">
  52. <li><a href="../../../../org/jfree/chart/servlet/DisplayChart.html" title="class in org.jfree.chart.servlet"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  53. <li>Next&nbsp;Class</li>
  54. </ul>
  55. <ul class="navList">
  56. <li><a href="../../../../index.html?org/jfree/chart/servlet/ServletUtilities.html" target="_top">Frames</a></li>
  57. <li><a href="ServletUtilities.html" target="_top">No&nbsp;Frames</a></li>
  58. </ul>
  59. <ul class="navList" id="allclasses_navbar_top">
  60. <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  61. </ul>
  62. <div>
  63. <script type="text/javascript"><!--
  64. allClassesLink = document.getElementById("allclasses_navbar_top");
  65. if(window==top) {
  66. allClassesLink.style.display = "block";
  67. }
  68. else {
  69. allClassesLink.style.display = "none";
  70. }
  71. //-->
  72. </script>
  73. </div>
  74. <div>
  75. <ul class="subNavList">
  76. <li>Summary:&nbsp;</li>
  77. <li>Nested&nbsp;|&nbsp;</li>
  78. <li>Field&nbsp;|&nbsp;</li>
  79. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  80. <li><a href="#method.summary">Method</a></li>
  81. </ul>
  82. <ul class="subNavList">
  83. <li>Detail:&nbsp;</li>
  84. <li>Field&nbsp;|&nbsp;</li>
  85. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  86. <li><a href="#method.detail">Method</a></li>
  87. </ul>
  88. </div>
  89. <a name="skip.navbar.top">
  90. <!-- -->
  91. </a></div>
  92. <!-- ========= END OF TOP NAVBAR ========= -->
  93. <!-- ======== START OF CLASS DATA ======== -->
  94. <div class="header">
  95. <div class="subTitle">org.jfree.chart.servlet</div>
  96. <h2 title="Class ServletUtilities" class="title">Class ServletUtilities</h2>
  97. </div>
  98. <div class="contentContainer">
  99. <ul class="inheritance">
  100. <li>java.lang.Object</li>
  101. <li>
  102. <ul class="inheritance">
  103. <li>org.jfree.chart.servlet.ServletUtilities</li>
  104. </ul>
  105. </li>
  106. </ul>
  107. <div class="description">
  108. <ul class="blockList">
  109. <li class="blockList">
  110. <hr>
  111. <br>
  112. <pre>public class <a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.82">ServletUtilities</a>
  113. extends java.lang.Object</pre>
  114. <div class="block">Utility class used for servlet related JFreeChart operations.</div>
  115. </li>
  116. </ul>
  117. </div>
  118. <div class="summary">
  119. <ul class="blockList">
  120. <li class="blockList">
  121. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  122. <ul class="blockList">
  123. <li class="blockList"><a name="constructor.summary">
  124. <!-- -->
  125. </a>
  126. <h3>Constructor Summary</h3>
  127. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  128. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  129. <tr>
  130. <th class="colOne" scope="col">Constructor and Description</th>
  131. </tr>
  132. <tr class="altColor">
  133. <td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#ServletUtilities--">ServletUtilities</a></span>()</code>&nbsp;</td>
  134. </tr>
  135. </table>
  136. </li>
  137. </ul>
  138. <!-- ========== METHOD SUMMARY =========== -->
  139. <ul class="blockList">
  140. <li class="blockList"><a name="method.summary">
  141. <!-- -->
  142. </a>
  143. <h3>Method Summary</h3>
  144. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  145. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
  146. <tr>
  147. <th class="colFirst" scope="col">Modifier and Type</th>
  148. <th class="colLast" scope="col">Method and Description</th>
  149. </tr>
  150. <tr id="i0" class="altColor">
  151. <td class="colFirst"><code>protected static void</code></td>
  152. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#createTempDir--">createTempDir</a></span>()</code>
  153. <div class="block">Creates the temporary directory if it does not exist.</div>
  154. </td>
  155. </tr>
  156. <tr id="i1" class="rowColor">
  157. <td class="colFirst"><code>static java.lang.String</code></td>
  158. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#getTempFilePrefix--">getTempFilePrefix</a></span>()</code>
  159. <div class="block">Returns the prefix for the temporary file names generated by this class.</div>
  160. </td>
  161. </tr>
  162. <tr id="i2" class="altColor">
  163. <td class="colFirst"><code>static java.lang.String</code></td>
  164. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#getTempOneTimeFilePrefix--">getTempOneTimeFilePrefix</a></span>()</code>
  165. <div class="block">Returns the prefix for "one time" temporary file names generated by
  166. this class.</div>
  167. </td>
  168. </tr>
  169. <tr id="i3" class="rowColor">
  170. <td class="colFirst"><code>protected static void</code></td>
  171. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#registerChartForDeletion-java.io.File-javax.servlet.http.HttpSession-">registerChartForDeletion</a></span>(java.io.File&nbsp;tempFile,
  172. javax.servlet.http.HttpSession&nbsp;session)</code>
  173. <div class="block">Adds a <a href="../../../../org/jfree/chart/servlet/ChartDeleter.html" title="class in org.jfree.chart.servlet"><code>ChartDeleter</code></a> object to the session object with the name
  174. <code>JFreeChart_Deleter</code> if there is not already one bound to the
  175. session and adds the filename to the list of charts to be deleted.</div>
  176. </td>
  177. </tr>
  178. <tr id="i4" class="altColor">
  179. <td class="colFirst"><code>static java.lang.String</code></td>
  180. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#saveChartAsJPEG-org.jfree.chart.JFreeChart-int-int-org.jfree.chart.ChartRenderingInfo-javax.servlet.http.HttpSession-">saveChartAsJPEG</a></span>(<a href="../../../../org/jfree/chart/JFreeChart.html" title="class in org.jfree.chart">JFreeChart</a>&nbsp;chart,
  181. int&nbsp;width,
  182. int&nbsp;height,
  183. <a href="../../../../org/jfree/chart/ChartRenderingInfo.html" title="class in org.jfree.chart">ChartRenderingInfo</a>&nbsp;info,
  184. javax.servlet.http.HttpSession&nbsp;session)</code>
  185. <div class="block">Saves the chart as a JPEG format file in the temporary directory and
  186. populates the <code>ChartRenderingInfo</code> object which can be used
  187. to generate an HTML image map.</div>
  188. </td>
  189. </tr>
  190. <tr id="i5" class="rowColor">
  191. <td class="colFirst"><code>static java.lang.String</code></td>
  192. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#saveChartAsJPEG-org.jfree.chart.JFreeChart-int-int-javax.servlet.http.HttpSession-">saveChartAsJPEG</a></span>(<a href="../../../../org/jfree/chart/JFreeChart.html" title="class in org.jfree.chart">JFreeChart</a>&nbsp;chart,
  193. int&nbsp;width,
  194. int&nbsp;height,
  195. javax.servlet.http.HttpSession&nbsp;session)</code>
  196. <div class="block">Saves the chart as a JPEG format file in the temporary directory.</div>
  197. </td>
  198. </tr>
  199. <tr id="i6" class="altColor">
  200. <td class="colFirst"><code>static java.lang.String</code></td>
  201. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#saveChartAsPNG-org.jfree.chart.JFreeChart-int-int-org.jfree.chart.ChartRenderingInfo-javax.servlet.http.HttpSession-">saveChartAsPNG</a></span>(<a href="../../../../org/jfree/chart/JFreeChart.html" title="class in org.jfree.chart">JFreeChart</a>&nbsp;chart,
  202. int&nbsp;width,
  203. int&nbsp;height,
  204. <a href="../../../../org/jfree/chart/ChartRenderingInfo.html" title="class in org.jfree.chart">ChartRenderingInfo</a>&nbsp;info,
  205. javax.servlet.http.HttpSession&nbsp;session)</code>
  206. <div class="block">Saves the chart as a PNG format file in the temporary directory and
  207. populates the <a href="../../../../org/jfree/chart/ChartRenderingInfo.html" title="class in org.jfree.chart"><code>ChartRenderingInfo</code></a> object which can be used to
  208. generate an HTML image map.</div>
  209. </td>
  210. </tr>
  211. <tr id="i7" class="rowColor">
  212. <td class="colFirst"><code>static java.lang.String</code></td>
  213. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#saveChartAsPNG-org.jfree.chart.JFreeChart-int-int-javax.servlet.http.HttpSession-">saveChartAsPNG</a></span>(<a href="../../../../org/jfree/chart/JFreeChart.html" title="class in org.jfree.chart">JFreeChart</a>&nbsp;chart,
  214. int&nbsp;width,
  215. int&nbsp;height,
  216. javax.servlet.http.HttpSession&nbsp;session)</code>
  217. <div class="block">Saves the chart as a PNG format file in the temporary directory.</div>
  218. </td>
  219. </tr>
  220. <tr id="i8" class="altColor">
  221. <td class="colFirst"><code>static java.lang.String</code></td>
  222. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#searchReplace-java.lang.String-java.lang.String-java.lang.String-">searchReplace</a></span>(java.lang.String&nbsp;inputString,
  223. java.lang.String&nbsp;searchString,
  224. java.lang.String&nbsp;replaceString)</code>
  225. <div class="block">Perform a search/replace operation on a String
  226. There are String methods to do this since (JDK 1.4)</div>
  227. </td>
  228. </tr>
  229. <tr id="i9" class="rowColor">
  230. <td class="colFirst"><code>static void</code></td>
  231. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#sendTempFile-java.io.File-javax.servlet.http.HttpServletResponse-">sendTempFile</a></span>(java.io.File&nbsp;file,
  232. javax.servlet.http.HttpServletResponse&nbsp;response)</code>
  233. <div class="block">Binary streams the specified file to the HTTP response in 1KB chunks.</div>
  234. </td>
  235. </tr>
  236. <tr id="i10" class="altColor">
  237. <td class="colFirst"><code>static void</code></td>
  238. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#sendTempFile-java.io.File-javax.servlet.http.HttpServletResponse-java.lang.String-">sendTempFile</a></span>(java.io.File&nbsp;file,
  239. javax.servlet.http.HttpServletResponse&nbsp;response,
  240. java.lang.String&nbsp;mimeType)</code>
  241. <div class="block">Binary streams the specified file to the HTTP response in 1KB chunks.</div>
  242. </td>
  243. </tr>
  244. <tr id="i11" class="rowColor">
  245. <td class="colFirst"><code>static void</code></td>
  246. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#sendTempFile-java.lang.String-javax.servlet.http.HttpServletResponse-">sendTempFile</a></span>(java.lang.String&nbsp;filename,
  247. javax.servlet.http.HttpServletResponse&nbsp;response)</code>
  248. <div class="block">Binary streams the specified file in the temporary directory to the
  249. HTTP response in 1KB chunks.</div>
  250. </td>
  251. </tr>
  252. <tr id="i12" class="altColor">
  253. <td class="colFirst"><code>static void</code></td>
  254. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#setTempFilePrefix-java.lang.String-">setTempFilePrefix</a></span>(java.lang.String&nbsp;prefix)</code>
  255. <div class="block">Sets the prefix for the temporary file names generated by this class.</div>
  256. </td>
  257. </tr>
  258. <tr id="i13" class="rowColor">
  259. <td class="colFirst"><code>static void</code></td>
  260. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jfree/chart/servlet/ServletUtilities.html#setTempOneTimeFilePrefix-java.lang.String-">setTempOneTimeFilePrefix</a></span>(java.lang.String&nbsp;prefix)</code>
  261. <div class="block">Sets the prefix for the "one time" temporary file names generated by
  262. this class.</div>
  263. </td>
  264. </tr>
  265. </table>
  266. <ul class="blockList">
  267. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  268. <!-- -->
  269. </a>
  270. <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
  271. <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
  272. </ul>
  273. </li>
  274. </ul>
  275. </li>
  276. </ul>
  277. </div>
  278. <div class="details">
  279. <ul class="blockList">
  280. <li class="blockList">
  281. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  282. <ul class="blockList">
  283. <li class="blockList"><a name="constructor.detail">
  284. <!-- -->
  285. </a>
  286. <h3>Constructor Detail</h3>
  287. <a name="ServletUtilities--">
  288. <!-- -->
  289. </a>
  290. <ul class="blockListLast">
  291. <li class="blockList">
  292. <h4>ServletUtilities</h4>
  293. <pre>public&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.82">ServletUtilities</a>()</pre>
  294. </li>
  295. </ul>
  296. </li>
  297. </ul>
  298. <!-- ============ METHOD DETAIL ========== -->
  299. <ul class="blockList">
  300. <li class="blockList"><a name="method.detail">
  301. <!-- -->
  302. </a>
  303. <h3>Method Detail</h3>
  304. <a name="getTempFilePrefix--">
  305. <!-- -->
  306. </a>
  307. <ul class="blockList">
  308. <li class="blockList">
  309. <h4>getTempFilePrefix</h4>
  310. <pre>public static&nbsp;java.lang.String&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.95">getTempFilePrefix</a>()</pre>
  311. <div class="block">Returns the prefix for the temporary file names generated by this class.</div>
  312. <dl>
  313. <dt><span class="returnLabel">Returns:</span></dt>
  314. <dd>The prefix (never <code>null</code>).</dd>
  315. </dl>
  316. </li>
  317. </ul>
  318. <a name="setTempFilePrefix-java.lang.String-">
  319. <!-- -->
  320. </a>
  321. <ul class="blockList">
  322. <li class="blockList">
  323. <h4>setTempFilePrefix</h4>
  324. <pre>public static&nbsp;void&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.104">setTempFilePrefix</a>(java.lang.String&nbsp;prefix)</pre>
  325. <div class="block">Sets the prefix for the temporary file names generated by this class.</div>
  326. <dl>
  327. <dt><span class="paramLabel">Parameters:</span></dt>
  328. <dd><code>prefix</code> - the prefix (<code>null</code> not permitted).</dd>
  329. </dl>
  330. </li>
  331. </ul>
  332. <a name="getTempOneTimeFilePrefix--">
  333. <!-- -->
  334. </a>
  335. <ul class="blockList">
  336. <li class="blockList">
  337. <h4>getTempOneTimeFilePrefix</h4>
  338. <pre>public static&nbsp;java.lang.String&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.115">getTempOneTimeFilePrefix</a>()</pre>
  339. <div class="block">Returns the prefix for "one time" temporary file names generated by
  340. this class.</div>
  341. <dl>
  342. <dt><span class="returnLabel">Returns:</span></dt>
  343. <dd>The prefix.</dd>
  344. </dl>
  345. </li>
  346. </ul>
  347. <a name="setTempOneTimeFilePrefix-java.lang.String-">
  348. <!-- -->
  349. </a>
  350. <ul class="blockList">
  351. <li class="blockList">
  352. <h4>setTempOneTimeFilePrefix</h4>
  353. <pre>public static&nbsp;void&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.125">setTempOneTimeFilePrefix</a>(java.lang.String&nbsp;prefix)</pre>
  354. <div class="block">Sets the prefix for the "one time" temporary file names generated by
  355. this class.</div>
  356. <dl>
  357. <dt><span class="paramLabel">Parameters:</span></dt>
  358. <dd><code>prefix</code> - the prefix (<code>null</code> not permitted).</dd>
  359. </dl>
  360. </li>
  361. </ul>
  362. <a name="saveChartAsPNG-org.jfree.chart.JFreeChart-int-int-javax.servlet.http.HttpSession-">
  363. <!-- -->
  364. </a>
  365. <ul class="blockList">
  366. <li class="blockList">
  367. <h4>saveChartAsPNG</h4>
  368. <pre>public static&nbsp;java.lang.String&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.145">saveChartAsPNG</a>(<a href="../../../../org/jfree/chart/JFreeChart.html" title="class in org.jfree.chart">JFreeChart</a>&nbsp;chart,
  369. int&nbsp;width,
  370. int&nbsp;height,
  371. javax.servlet.http.HttpSession&nbsp;session)
  372. throws java.io.IOException</pre>
  373. <div class="block">Saves the chart as a PNG format file in the temporary directory.</div>
  374. <dl>
  375. <dt><span class="paramLabel">Parameters:</span></dt>
  376. <dd><code>chart</code> - the JFreeChart to be saved.</dd>
  377. <dd><code>width</code> - the width of the chart.</dd>
  378. <dd><code>height</code> - the height of the chart.</dd>
  379. <dd><code>session</code> - the HttpSession of the client (if <code>null</code>, the
  380. temporary file is marked as "one-time" and deleted by
  381. the <a href="../../../../org/jfree/chart/servlet/DisplayChart.html" title="class in org.jfree.chart.servlet"><code>DisplayChart</code></a> servlet right after it is
  382. streamed to the client).</dd>
  383. <dt><span class="returnLabel">Returns:</span></dt>
  384. <dd>The filename of the chart saved in the temporary directory.</dd>
  385. <dt><span class="throwsLabel">Throws:</span></dt>
  386. <dd><code>java.io.IOException</code> - if there is a problem saving the file.</dd>
  387. </dl>
  388. </li>
  389. </ul>
  390. <a name="saveChartAsPNG-org.jfree.chart.JFreeChart-int-int-org.jfree.chart.ChartRenderingInfo-javax.servlet.http.HttpSession-">
  391. <!-- -->
  392. </a>
  393. <ul class="blockList">
  394. <li class="blockList">
  395. <h4>saveChartAsPNG</h4>
  396. <pre>public static&nbsp;java.lang.String&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.172">saveChartAsPNG</a>(<a href="../../../../org/jfree/chart/JFreeChart.html" title="class in org.jfree.chart">JFreeChart</a>&nbsp;chart,
  397. int&nbsp;width,
  398. int&nbsp;height,
  399. <a href="../../../../org/jfree/chart/ChartRenderingInfo.html" title="class in org.jfree.chart">ChartRenderingInfo</a>&nbsp;info,
  400. javax.servlet.http.HttpSession&nbsp;session)
  401. throws java.io.IOException</pre>
  402. <div class="block">Saves the chart as a PNG format file in the temporary directory and
  403. populates the <a href="../../../../org/jfree/chart/ChartRenderingInfo.html" title="class in org.jfree.chart"><code>ChartRenderingInfo</code></a> object which can be used to
  404. generate an HTML image map.</div>
  405. <dl>
  406. <dt><span class="paramLabel">Parameters:</span></dt>
  407. <dd><code>chart</code> - the chart to be saved (<code>null</code> not permitted).</dd>
  408. <dd><code>width</code> - the width of the chart.</dd>
  409. <dd><code>height</code> - the height of the chart.</dd>
  410. <dd><code>info</code> - the ChartRenderingInfo object to be populated
  411. (<code>null</code> permitted).</dd>
  412. <dd><code>session</code> - the HttpSession of the client (if <code>null</code>, the
  413. temporary file is marked as "one-time" and deleted by
  414. the <a href="../../../../org/jfree/chart/servlet/DisplayChart.html" title="class in org.jfree.chart.servlet"><code>DisplayChart</code></a> servlet right after it is
  415. streamed to the client).</dd>
  416. <dt><span class="returnLabel">Returns:</span></dt>
  417. <dd>The filename of the chart saved in the temporary directory.</dd>
  418. <dt><span class="throwsLabel">Throws:</span></dt>
  419. <dd><code>java.io.IOException</code> - if there is a problem saving the file.</dd>
  420. </dl>
  421. </li>
  422. </ul>
  423. <a name="saveChartAsJPEG-org.jfree.chart.JFreeChart-int-int-javax.servlet.http.HttpSession-">
  424. <!-- -->
  425. </a>
  426. <ul class="blockList">
  427. <li class="blockList">
  428. <h4>saveChartAsJPEG</h4>
  429. <pre>public static&nbsp;java.lang.String&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.211">saveChartAsJPEG</a>(<a href="../../../../org/jfree/chart/JFreeChart.html" title="class in org.jfree.chart">JFreeChart</a>&nbsp;chart,
  430. int&nbsp;width,
  431. int&nbsp;height,
  432. javax.servlet.http.HttpSession&nbsp;session)
  433. throws java.io.IOException</pre>
  434. <div class="block">Saves the chart as a JPEG format file in the temporary directory.
  435. <p>
  436. SPECIAL NOTE: Please avoid using JPEG as an image format for charts,
  437. it is a "lossy" format that introduces visible distortions in the
  438. resulting image - use PNG instead. In addition, note that JPEG output
  439. is supported by JFreeChart only for JRE 1.4.2 or later.</div>
  440. <dl>
  441. <dt><span class="paramLabel">Parameters:</span></dt>
  442. <dd><code>chart</code> - the JFreeChart to be saved.</dd>
  443. <dd><code>width</code> - the width of the chart.</dd>
  444. <dd><code>height</code> - the height of the chart.</dd>
  445. <dd><code>session</code> - the HttpSession of the client (if <code>null</code>, the
  446. temporary file is marked as "one-time" and deleted by
  447. the <a href="../../../../org/jfree/chart/servlet/DisplayChart.html" title="class in org.jfree.chart.servlet"><code>DisplayChart</code></a> servlet right after it is
  448. streamed to the client).</dd>
  449. <dt><span class="returnLabel">Returns:</span></dt>
  450. <dd>The filename of the chart saved in the temporary directory.</dd>
  451. <dt><span class="throwsLabel">Throws:</span></dt>
  452. <dd><code>java.io.IOException</code> - if there is a problem saving the file.</dd>
  453. </dl>
  454. </li>
  455. </ul>
  456. <a name="saveChartAsJPEG-org.jfree.chart.JFreeChart-int-int-org.jfree.chart.ChartRenderingInfo-javax.servlet.http.HttpSession-">
  457. <!-- -->
  458. </a>
  459. <ul class="blockList">
  460. <li class="blockList">
  461. <h4>saveChartAsJPEG</h4>
  462. <pre>public static&nbsp;java.lang.String&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.243">saveChartAsJPEG</a>(<a href="../../../../org/jfree/chart/JFreeChart.html" title="class in org.jfree.chart">JFreeChart</a>&nbsp;chart,
  463. int&nbsp;width,
  464. int&nbsp;height,
  465. <a href="../../../../org/jfree/chart/ChartRenderingInfo.html" title="class in org.jfree.chart">ChartRenderingInfo</a>&nbsp;info,
  466. javax.servlet.http.HttpSession&nbsp;session)
  467. throws java.io.IOException</pre>
  468. <div class="block">Saves the chart as a JPEG format file in the temporary directory and
  469. populates the <code>ChartRenderingInfo</code> object which can be used
  470. to generate an HTML image map.
  471. <p>
  472. SPECIAL NOTE: Please avoid using JPEG as an image format for charts,
  473. it is a "lossy" format that introduces visible distortions in the
  474. resulting image - use PNG instead. In addition, note that JPEG output
  475. is supported by JFreeChart only for JRE 1.4.2 or later.</div>
  476. <dl>
  477. <dt><span class="paramLabel">Parameters:</span></dt>
  478. <dd><code>chart</code> - the chart to be saved (<code>null</code> not permitted).</dd>
  479. <dd><code>width</code> - the width of the chart</dd>
  480. <dd><code>height</code> - the height of the chart</dd>
  481. <dd><code>info</code> - the ChartRenderingInfo object to be populated</dd>
  482. <dd><code>session</code> - the HttpSession of the client (if <code>null</code>, the
  483. temporary file is marked as "one-time" and deleted by
  484. the <a href="../../../../org/jfree/chart/servlet/DisplayChart.html" title="class in org.jfree.chart.servlet"><code>DisplayChart</code></a> servlet right after it is
  485. streamed to the client).</dd>
  486. <dt><span class="returnLabel">Returns:</span></dt>
  487. <dd>The filename of the chart saved in the temporary directory</dd>
  488. <dt><span class="throwsLabel">Throws:</span></dt>
  489. <dd><code>java.io.IOException</code> - if there is a problem saving the file.</dd>
  490. </dl>
  491. </li>
  492. </ul>
  493. <a name="createTempDir--">
  494. <!-- -->
  495. </a>
  496. <ul class="blockList">
  497. <li class="blockList">
  498. <h4>createTempDir</h4>
  499. <pre>protected static&nbsp;void&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.272">createTempDir</a>()</pre>
  500. <div class="block">Creates the temporary directory if it does not exist. Throws a
  501. <code>RuntimeException</code> if the temporary directory is
  502. <code>null</code>. Uses the system property <code>java.io.tmpdir</code>
  503. as the temporary directory. This sounds like a strange thing to do but
  504. my temporary directory was not created on my default Tomcat 4.0.3
  505. installation. Could save some questions on the forum if it is created
  506. when not present.</div>
  507. </li>
  508. </ul>
  509. <a name="registerChartForDeletion-java.io.File-javax.servlet.http.HttpSession-">
  510. <!-- -->
  511. </a>
  512. <ul class="blockList">
  513. <li class="blockList">
  514. <h4>registerChartForDeletion</h4>
  515. <pre>protected static&nbsp;void&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.294">registerChartForDeletion</a>(java.io.File&nbsp;tempFile,
  516. javax.servlet.http.HttpSession&nbsp;session)</pre>
  517. <div class="block">Adds a <a href="../../../../org/jfree/chart/servlet/ChartDeleter.html" title="class in org.jfree.chart.servlet"><code>ChartDeleter</code></a> object to the session object with the name
  518. <code>JFreeChart_Deleter</code> if there is not already one bound to the
  519. session and adds the filename to the list of charts to be deleted.</div>
  520. <dl>
  521. <dt><span class="paramLabel">Parameters:</span></dt>
  522. <dd><code>tempFile</code> - the file to be deleted.</dd>
  523. <dd><code>session</code> - the HTTP session of the client.</dd>
  524. </dl>
  525. </li>
  526. </ul>
  527. <a name="sendTempFile-java.lang.String-javax.servlet.http.HttpServletResponse-">
  528. <!-- -->
  529. </a>
  530. <ul class="blockList">
  531. <li class="blockList">
  532. <h4>sendTempFile</h4>
  533. <pre>public static&nbsp;void&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.321">sendTempFile</a>(java.lang.String&nbsp;filename,
  534. javax.servlet.http.HttpServletResponse&nbsp;response)
  535. throws java.io.IOException</pre>
  536. <div class="block">Binary streams the specified file in the temporary directory to the
  537. HTTP response in 1KB chunks.</div>
  538. <dl>
  539. <dt><span class="paramLabel">Parameters:</span></dt>
  540. <dd><code>filename</code> - the name of the file in the temporary directory.</dd>
  541. <dd><code>response</code> - the HTTP response object.</dd>
  542. <dt><span class="throwsLabel">Throws:</span></dt>
  543. <dd><code>java.io.IOException</code> - if there is an I/O problem.</dd>
  544. </dl>
  545. </li>
  546. </ul>
  547. <a name="sendTempFile-java.io.File-javax.servlet.http.HttpServletResponse-">
  548. <!-- -->
  549. </a>
  550. <ul class="blockList">
  551. <li class="blockList">
  552. <h4>sendTempFile</h4>
  553. <pre>public static&nbsp;void&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.336">sendTempFile</a>(java.io.File&nbsp;file,
  554. javax.servlet.http.HttpServletResponse&nbsp;response)
  555. throws java.io.IOException</pre>
  556. <div class="block">Binary streams the specified file to the HTTP response in 1KB chunks.</div>
  557. <dl>
  558. <dt><span class="paramLabel">Parameters:</span></dt>
  559. <dd><code>file</code> - the file to be streamed.</dd>
  560. <dd><code>response</code> - the HTTP response object.</dd>
  561. <dt><span class="throwsLabel">Throws:</span></dt>
  562. <dd><code>java.io.IOException</code> - if there is an I/O problem.</dd>
  563. </dl>
  564. </li>
  565. </ul>
  566. <a name="sendTempFile-java.io.File-javax.servlet.http.HttpServletResponse-java.lang.String-">
  567. <!-- -->
  568. </a>
  569. <ul class="blockList">
  570. <li class="blockList">
  571. <h4>sendTempFile</h4>
  572. <pre>public static&nbsp;void&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.363">sendTempFile</a>(java.io.File&nbsp;file,
  573. javax.servlet.http.HttpServletResponse&nbsp;response,
  574. java.lang.String&nbsp;mimeType)
  575. throws java.io.IOException</pre>
  576. <div class="block">Binary streams the specified file to the HTTP response in 1KB chunks.</div>
  577. <dl>
  578. <dt><span class="paramLabel">Parameters:</span></dt>
  579. <dd><code>file</code> - the file to be streamed.</dd>
  580. <dd><code>response</code> - the HTTP response object.</dd>
  581. <dd><code>mimeType</code> - the mime type of the file, null allowed.</dd>
  582. <dt><span class="throwsLabel">Throws:</span></dt>
  583. <dd><code>java.io.IOException</code> - if there is an I/O problem.</dd>
  584. </dl>
  585. </li>
  586. </ul>
  587. <a name="searchReplace-java.lang.String-java.lang.String-java.lang.String-">
  588. <!-- -->
  589. </a>
  590. <ul class="blockListLast">
  591. <li class="blockList">
  592. <h4>searchReplace</h4>
  593. <pre>public static&nbsp;java.lang.String&nbsp;<a href="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.413">searchReplace</a>(java.lang.String&nbsp;inputString,
  594. java.lang.String&nbsp;searchString,
  595. java.lang.String&nbsp;replaceString)</pre>
  596. <div class="block">Perform a search/replace operation on a String
  597. There are String methods to do this since (JDK 1.4)</div>
  598. <dl>
  599. <dt><span class="paramLabel">Parameters:</span></dt>
  600. <dd><code>inputString</code> - the String to have the search/replace operation.</dd>
  601. <dd><code>searchString</code> - the search String.</dd>
  602. <dd><code>replaceString</code> - the replace String.</dd>
  603. <dt><span class="returnLabel">Returns:</span></dt>
  604. <dd>The String with the replacements made.</dd>
  605. </dl>
  606. </li>
  607. </ul>
  608. </li>
  609. </ul>
  610. </li>
  611. </ul>
  612. </div>
  613. </div>
  614. <!-- ========= END OF CLASS DATA ========= -->
  615. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  616. <div class="bottomNav"><a name="navbar.bottom">
  617. <!-- -->
  618. </a>
  619. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  620. <a name="navbar.bottom.firstrow">
  621. <!-- -->
  622. </a>
  623. <ul class="navList" title="Navigation">
  624. <li><a href="../../../../overview-summary.html">Overview</a></li>
  625. <li><a href="package-summary.html">Package</a></li>
  626. <li class="navBarCell1Rev">Class</li>
  627. <li><a href="class-use/ServletUtilities.html">Use</a></li>
  628. <li><a href="package-tree.html">Tree</a></li>
  629. <li><a href="../../../../deprecated-list.html">Deprecated</a></li>
  630. <li><a href="../../../../index-files/index-1.html">Index</a></li>
  631. <li><a href="../../../../help-doc.html">Help</a></li>
  632. </ul>
  633. </div>
  634. <div class="subNav">
  635. <ul class="navList">
  636. <li><a href="../../../../org/jfree/chart/servlet/DisplayChart.html" title="class in org.jfree.chart.servlet"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  637. <li>Next&nbsp;Class</li>
  638. </ul>
  639. <ul class="navList">
  640. <li><a href="../../../../index.html?org/jfree/chart/servlet/ServletUtilities.html" target="_top">Frames</a></li>
  641. <li><a href="ServletUtilities.html" target="_top">No&nbsp;Frames</a></li>
  642. </ul>
  643. <ul class="navList" id="allclasses_navbar_bottom">
  644. <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  645. </ul>
  646. <div>
  647. <script type="text/javascript"><!--
  648. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  649. if(window==top) {
  650. allClassesLink.style.display = "block";
  651. }
  652. else {
  653. allClassesLink.style.display = "none";
  654. }
  655. //-->
  656. </script>
  657. </div>
  658. <div>
  659. <ul class="subNavList">
  660. <li>Summary:&nbsp;</li>
  661. <li>Nested&nbsp;|&nbsp;</li>
  662. <li>Field&nbsp;|&nbsp;</li>
  663. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  664. <li><a href="#method.summary">Method</a></li>
  665. </ul>
  666. <ul class="subNavList">
  667. <li>Detail:&nbsp;</li>
  668. <li>Field&nbsp;|&nbsp;</li>
  669. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  670. <li><a href="#method.detail">Method</a></li>
  671. </ul>
  672. </div>
  673. <a name="skip.navbar.bottom">
  674. <!-- -->
  675. </a></div>
  676. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  677. </body>
  678. </html>