• Post Reply Bookmark Topic Watch Topic
  • New Topic

Input Streams: Access denied?  RSS feed

 
Sam Thompson
Ranch Hand
Posts: 93
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all:

I am currently writing a small program that will be stored on both my computers and will come up with a list of all the music files I have and store them in an ArrayList of type String.

I know how to import it- for the most part. However, I am having one problem with it so far. Every time I try to run it, I get this:



It says that Access is denied. Why? How do I get around this? My computer IS password protected. I put in a password every time I log on. Does that affect it somehow? Or is it something else that I am not realizing?
What can I do to get around this?

Here is the code:



Any help would be greatly appreciated.

Thanks again everyone!

S.T.
 
Mike Simmons
Ranch Hand
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, is Music a normal file, or a directory? I'm guessing it's a directory, in which case you probably shouldn't be trying to open it with a FileReader. Perhaps you can try the listFiles() method instead?
 
Sam Thompson
Ranch Hand
Posts: 93
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike:

Thanks a bunch. Your suggestion worked.

I'll use that from now on. I kinda figured it had to be something simpler than what I was doing.

Thanks again

S.T.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!