ServletUtilities

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
neal

ServletUtilities

Post by neal » Mon Aug 09, 2004 9:54 am

would it be ok if in the ServletUtilities class it will have a method that will set and get the image directory coz for nor it only and always save the image in System.getProperty("java.io.tmpdir")...

My idea is that anytime we can set the image directory...

it will looks like this...

//default value if it is not set...
private static String tempFileDirectory = System.getProperty("java.io.tmpdir");

public static void setTempFileDirectory(String directory)
{
if (directory == null)
{
throw new IllegalArgumentException("Null 'directory' argument.");
}
ServletUtilities.tempFileDirectory = directory;
}

public static String getTempFileDirectory() {
return ServletUtilities.tempFileDirectory;
}

Thanks!...

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue Aug 10, 2004 9:49 am

I can't see a problem with that, but I'll run it past the original author of the class anyway (he knows more about it than I do). I've e-mailed him.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

richard_atkinson
Posts: 115
Joined: Fri Mar 14, 2003 3:13 pm
Location: London, England
Contact:

ServletUtilities

Post by richard_atkinson » Tue Aug 10, 2004 3:00 pm

I do not have a particular problem with the change. But do you have a particular reason why you could not just change the java.io.tmpdir using System.setProperty(...)? Do you particularly need your charts stored in a different temporary directory to other temporary files? If you do not need the DisplayChart servlet functionality and auto-deletion at the end of the session, consider using the ChartUtilities methods to save the image in the directory of your choice.

Regards,
Richard...

Guest

Post by Guest » Wed Aug 11, 2004 2:52 am

There is alternative way not to store the image in filesystem, but store in stream buffer instead.

Locked