• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Directory Creation

 
Arpit Gadle
Ranch Hand
Posts: 69
Linux MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I want to create a directory(in tomcat) inside my current webapplication i.e DemoDirApp. This is the code of the servlet. This servlet code creates the directory in C:\ where the tomcat is installed



Need your help


Regards
Arpit U. Gadle
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uhm, what exactly is your problem ? Do exceptions occus ?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


If you expected that directory to be relative to your application, you have the wrong idea.

The class java.io.File deals with operating system directories, to get the translation from application relative to operating system, look into the ServletContext getRealPath() documentation.

Bill
 
Arpit Gadle
Ranch Hand
Posts: 69
Linux MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks Williams,

There is indeed know that the path which I used is wrong and thanks for giving the correct explanation. Will check with the getRealPath().


Thanks
Arpit
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic