File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FileNotFoundException - Access is denied

 
kamilla miesak
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I keep getting FileNotFoundException - Access is denied - when i'm trying to create and print to a file located in user's current working directory.
The same code works fine if I explicitly specify already existing folder i.e. c:\temp\test.txt (the new file gets created and contents are added to it). What might me causing the problem?
Thanks in advance for all the ideas!
Kamilla
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what's going on. How exactly are you attempting to create the new file? I suggest something like the following:

The getAbsolutePath() is useful because often people turn out to not be in the directory they think they are (depending on how they invoked the java command).
[ July 15, 2002: Message edited by: Jim Yingst ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic