create a folder or new file from servlet?

Discussion in 'Java' started by sk, Mar 9, 2007.

  1. sk

    sk Guest

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


    SK
     
    sk, Mar 9, 2007
    #1
    1. Advertising

  2. sk wrote:
    > 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
     
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Mar 12, 2007
    #2
    1. Advertising

  3. sk

    Garg Guest

    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
     
    Garg, Mar 12, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan
    Replies:
    7
    Views:
    18,657
    catherine sea
    Oct 28, 2010
  2. circuit_breaker
    Replies:
    2
    Views:
    2,091
    Jack Jia
    Apr 4, 2004
  3. Replies:
    2
    Views:
    342
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Dec 9, 2006
  4. madhu
    Replies:
    0
    Views:
    430
    madhu
    Oct 5, 2006
  5. Replies:
    4
    Views:
    851
Loading...

Share This Page