AccessControlException (access denied)
I can can use a BufferedReader to open a Streamat the command line, like this:
Code:
BufferedReader br = new BufferedReader(new InpuStreamReader(URL.openStream()));
Once I try to use this same statement inside of my applet, I get an AccessControlException. I know it's something to do with security, but how do you get around that?
Re: AccessControlException (access denied)
Quote:
Originally Posted by System_Error
I can can use a BufferedReader to open a Streamat the command line, like this:
Code:
BufferedReader br = new BufferedReader(new InpuStreamReader(URL.openStream()));
Once I try to use this same statement inside of my applet, I get an AccessControlException. I know it's something to do with security, but how do you get around that?
Code:
BufferedReader br = new BufferedReader(new InputStreamReader(URL.openStream()));
Your code needed a t in Input probably wasn't that though, since it threw an exception ;).
Have you tried .printStackTrace() and attempted to trace the error?
Re: AccessControlException (access denied)
Well, I finally found out what it was. I knew that applets didn't allow you access files and junk, but I never knew that trying to read from a url connection would cause problems. I did it at the console, and it worked. But for some reason applets have restriction to what I was trying to do.