Forums Register Login

How to locate outputStream using classLoader?

+Pie Number of slices to send: Send
I can locate a file that is in my class folder for INPUT using the following code:
ClassLoader loader = getClass().getClassLoader();
InputStream is = loader.getResourceAsStream( "AFile.txt" );
How to locate a file (in the same folder as the class) for OUTPUT using similar trick? getResourceAsStream() does not return an OutputStream!
Thanks.
Do you pee on your compost? Does this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2678 times.
Similar Threads
Top level classes
Description of folders in weblogic console
Urgent: cannot find property file in war when packaged in ear
Cant read XML file
getting the value of .properties file
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:57:55.