users@glassfish.java.net

Creating or reading files in GlassFish

From: <glassfish_at_javadesktop.org>
Date: Wed, 04 Feb 2009 18:36:32 PST

f = new File("webapps/Application/folder1/" + variable + ".xml");
            if (!f.exists()) {
                f.createNewFile();
            }

I used the above location when I created a file or read a file in tomcat. But under GlassFish, this doesn't work. Is there anyway I can write the codes that will work for all servers?

webapps is a folder in tomcat
Application is my webapp name
folder1 is a folder in my webapp
variable is a dynamic name for the file
[Message sent by forum member 'shadowbean' (shadowbean)]

http://forums.java.net/jive/thread.jspa?messageID=330215