create a folder or new file from servlet?

?

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

sk said:
Is it possible to create a folder or file on the web container with servlet?

If the security of the JVM and the OS allows it: yes.

Arne
 
G

Garg

I will suggest you to do is:

String[] str = {"D:","dir"};
Process proc = null;
ArrayList lines = new ArrayList();
BufferedReader in = null;
String s = null;
Runtime runtime = Runtime.getRuntime();
proc = runtime.exec(cmd);
in = new BufferedReader(new InputStreamReader(proc
.getInputStream()));
while ( (s = in.readLine()) != null )
{
lines.add(s);
}

Tarun
 

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,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top