• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Input Streams: Access denied?

 
Ranch Hand
Posts: 99
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Master Rancher
Posts: 4806
72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 99
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic