Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

relative path problem

 
Joshua Cloch
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys!

Here is the problem:

If I want to call an exe file when I donot use servlet,for example:

String[] info = {"c:\\ExecutableFileName.exe","c:\\filename.txt"};
Runtime.getRuntime().exec(info);

The code shown above works well.
Now I wanna move this to Tomcat using servlet.Suppose I put these two file in
webapps\test , How can I fine these two files?Any sample code is welcomed!

Thanks!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletContext.getRealPath();
 
Joshua Cloch
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much.The problem is solved.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic