Create a folder from a servlet

J

juddy.gomez

Hello

I have a Bean witch contains this method to create a Folder in my
webapp ( I am working with eclipse )

public boolean createFolder(string path) throws IOException {
boolean action= false;
String cmd =path;
File fd= new File(cmd);
action = fd.mkdir();
return action;
}

when I call the method from a class which contains a main method this
works perfect, the folder is created. But when I invoke this method
from a Servlet the folder is not created. I could not see the error
mesage.

Could you help me??

thanks
 
T

Tor Iver Wilhelmsen

when I call the method from a class which contains a main method this
works perfect, the folder is created. But when I invoke this method
from a Servlet the folder is not created. I could not see the error
mesage.

Do you use relative paths? Then keep in mind that the default dir in a
servlet container can be something else than you thought.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

I have a Bean witch contains this method to create a Folder in my
webapp ( I am working with eclipse )

public boolean createFolder(string path) throws IOException {
boolean action= false;
String cmd =path;
File fd= new File(cmd);
action = fd.mkdir();
return action;
}

when I call the method from a class which contains a main method this
works perfect, the folder is created. But when I invoke this method
from a Servlet the folder is not created. I could not see the error
mesage.

Maybe your servlet container does not allow the web app to
change itself ...

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top