Brian,
Not exactly what you're after, but close.
The following code creates a directory called 'home' in the root directory
of a context.
(Class 'File' can be used for manipulating directories as well as files)
// create home directory if none
String
homedirName=servlet.getServletContext().getRealPath("/")+"/home";
File homedir = new File(homedirName);
if (homedir!=null && !homedir.exists()) homedir.mkdir();
Regards,
John
[EMAIL PROTECTED]
Ph (09) 372-5010
|---------+---------------------------->
| | "Barnett, Brian |
| | W." |
| | <[EMAIL PROTECTED]|
| | inc.com> |
| | |
| | 27/08/2004 10:38 |
| | AM |
| | Please respond to|
| | "Struts Users |
| | Mailing List" |
| | |
|---------+---------------------------->
>--------------------------------------------------------------------------------------------------------------|
|
|
| To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
|
| cc:
|
| Subject: [OT] File IO
|
>--------------------------------------------------------------------------------------------------------------|
Hello,
Can someone point me to, or show me some sample java code, that opens,
reads, writes files using the relative path of the web application?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]