• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Input Streams: Access denied?

 
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 Foreman
Posts: 3263
19
  • 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.
 
I didn't do it. You can't prove it. Nobody saw me. The sheep are lying! This tiny ad is my witness!
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!