Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Copying files from a servlet  RSS feed

 
Shaun Appleton
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm running a servlet within JBoss/Tomcat I pass a file name to the servlet.
I need to copy the file to another location (both server side). I'm happy that my copy code works provided the directory I'm copying to already exists (manually created). When I try and copy the file with a full directory path in front of it, it fails. If I try and create the directory within code that again fails.
It only works with the full path if the full path already exists or it has no path. In which case it copies the file to the %JBOSS_HOME%/bin directory.
Is the server side file system locked out for servlets (except for %JBOSS_HOME%/bin)? If so is there a way to open up?
Thanks in advance,
Shaun
 
Shaun Appleton
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now sorted - using rt.exec() to do the file copying and creation of directory. The following page was helpful -
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps_p.html
Shaun
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!