This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes FileOutputStream error? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark " FileOutputStream error?" Watch " FileOutputStream error?" New topic
Author FileOutputStream error?

Al Cap

Joined: May 24, 2010
Posts: 1
Why I am getting a " resources\ (The system cannot find the path specified)" in the SetProperty method. The same "resources\" file is opening up in the GetProperty method without any problem.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24189


Welcome to JavaRanch!

Well, getResourceAsStream() looks for a resource relative to the roots of the class path; it can find files inside jars. But "new FileOutputStream()" expects a path that's relative to the current working directory, and can only open real files for writing. You're not trying to write into a file inside a jar file, are you?

[Jess in Action][AskingGoodQuestions]
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10744

In future, while posting code, please UseCodeTags

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: FileOutputStream error?
It's not a secret anymore!