Re: Loading Files

pro2@oak.njit.edu writes:

> If I have a HTTP Resource under 1.0b1 that wants to load a file from the
> server, where does the file need to be located?  I put it under WWW and
> get a FileNotFoundException.  

 You can put your file where you want. For example if you put it under WWW
 you can load it with:

 File myfile = new File( getServer().getRootDirectory(), 
                         "WWW/"+myfilename );
 ...

 But it's not a good idea to put it there, this directory is supposed to
 contains exported resources. So the best thing to do is to create your 
 own directory under the root directory (ie: myconfig) and to load your
 file with:

 File myfile = new File( getServer().getRootDirectory(), 
                         "myconfig/"+myfilename ); 

 ...
>How would this differ (if at all) under 2.0a?

 There'is no difference between 2.0 and 1.0 for this kind of things.

 Benoît.


- Benoît Mahé -------------------------------------------------------
                      World Wide Web Consortium (W3C)
                    Architecture domain - Jigsaw Team           

  http://www.w3.org/People/Mahe - bmahe@w3.org - +33.4.92.38.79.89 
---------------------------------------------------------------------

Received on Wednesday, 8 April 1998 03:03:02 UTC