This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Directory Creation

 
Arpit Gadle
Ranch Hand
Posts: 69
Linux MySQL Database
  • 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
  • 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: 13062
6
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic