Home arrow static arrow Java Programming [Archive] - getClass() and Output Streams
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - getClass() and Output Streams
This topic has 1 reply on 1 page.

Posts:32
Registered: 6/25/04
getClass() and Output Streams  
Jul 10, 2004 1:11 PM



 
I'm trying to save user preferences to a .Properties file, but I can't seem to correctly find the file when I give a relative path. I had no problem loading the file using:
InputStream inStream = getClass().getResourceAsStream(filename);try {    load(inStream);}catch (IOException e) {    System.out.println(e);}

The .getResourceAsStream(String) returned an InputStream, so that part was easy. I'm trying to find out if there is something similar to this method that returns an OutputStream or if there is a way to resolve the path to an InputStream to use in the construction of an OutputStream. Thank you for any information you can provide.
 

Posts:24,036
Registered: 2/3/03
Re: getClass() and Output Streams  
Jul 10, 2004 2:20 PM (reply 1 of 1)



 
getResource() returns a URL...
 
This topic has 1 reply on 1 page.