couple of questions

My session stores search results in a .htm file each. It also creates a Overview.htm with each search result listed and linked.

I need the date (dd-mm-yyyy-hh:mm) in the title of the Overview.htm, so I create Date() in the Initialize Session script.
Noelle showed us this:

Date date = new Date();
String d = date.toString();
d = d.substring(4,10);
//change to format mon-dd
d = d.replaceAll(" ","_");
session.setVariable( "SCRAPEDATE" , d );

How do I add year and time?

I want to store the search results in different folders, each named with a scraped token. So I need to know how to create folders.
I think about something like:

if(foldername == null){
create folder(foldername);
}
writefileinfolder;

But how to? ^^

More questions may follow.

Thanks in advance

(I fixed the link in

(I fixed the link in shadders' post to point to the most current API for Java. Google is littered with old java API links.)

To make folders, try something like this:

// First get the "foldername" without a file name on the end of it, then do this:
File folder = new File(foldername);
folder.mkdirs();

// writefileinfolder...

thx ^^

Thanks, that works great! New folders are createt when necessary, no need for any "if". Superb!

For your date conversions,

For your date conversions, rather than mess around trying to manipulate strings I'd suggest haveing a look at the java classes: DateFormat and SimpleDateFormat
They provide an easy way to manipulate dates from string to date or vice versa. i.e.

formatter = new SimpleDateFormat("dd/MM/yy hh:mm:ss a");
date = (Date)formatter.parse(tempStr);

You'll find them documented here: http://java.sun.com/javase/6/docs/api/

API nightmares ;)

I'm so not a programmer. These docs are like medieval Mandarin to me. But following your suggestion I searched for a tut and found this:
http://javatechniques.com/blog/dateformat-and-simpledateformat-examples/

The code I use now looks like that:
import java.text.DateFormat;
import java.util.Date;

Date date = new Date();
String d = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(date);
d = d.replaceAll(" ", "_");
d = d.replaceAll(":", "-");
session.setVariable( "SCRAPEDATE" , d );

Now with the help of you guys my scrapesession is how I wanted it. Thanks a lot.