+6  A: 

File.createTempFile() allows you to specify a directory so:

File uniqueFile = File.createTempFile("post", ".html", new File("/var/www/doc"));
cletus
A: 

You want the File.createTempFile(String, String, File) overload.

Which you would have seen immediately had you bothered to look at the documentation.

Anon.
Get you! ... :)
Tom Hawtin - tackline