mmmm if you nedd to access local files from an applet it must be signed!

check this link

http://www.qoppa.com/faq/signapplet.htm



2010/6/4 Michèle Garoche <[email protected]>

>
>
> On Jun 4, 4:57 pm, Somu <[email protected]> wrote:
> > hi,
> >
> > I m not able to access local files from my applet...
> > i know that JVM is strict about its security aspects.. but is there
> > any way by which i can
> > access file... atleast files located in my codebase ???
> >
> > The code i hav written in my public init() is
> >
> >  fin = new FileInputStream(getCodeBase().getPath()+"abc");
> >
> > but when i run in browser i get the following exception:
> >
> > java.security.AccessControlException: access denied
> > (java.io.FilePermission C:\Documents%20and%20Settings\Somnath\My
> > %20Documents\NetBeansProjects\health\build\classes\abc read)
> >     at java.security.AccessControlContext.checkPermission(Unknown
> > Source)
> >     at java.security.AccessController.checkPermission(Unknown Source)
> >     at java.lang.SecurityManager.checkPermission(Unknown Source)
> >     at java.lang.SecurityManager.checkRead(Unknown Source)
> >     at java.io.FileInputStream.<init>(Unknown Source)
> >     at java.io.FileInputStream.<init>(Unknown Source)
> >     at NewApplet.init(NewApplet.java:55)
> >     at sun.plugin2.applet.Plugin2Manager
> > $AppletExecutionRunnable.run(Unknown Source)
> >     at java.lang.Thread.run(Unknown Source)
> > Exception: java.security.AccessControlException: access denied
> > (java.io.FilePermission C:\Documents%20and%20Settings\Somnath\My
> > %20Documents\NetBeansProjects\health\build\classes\abc read)
> > java.lang.NullPointerException
> >     at NewApplet.start(NewApplet.java:70)
> >     at sun.plugin2.applet.Plugin2Manager
> > $AppletExecutionRunnable.run(Unknown Source)
> >     at java.lang.Thread.run(Unknown Source)
> >
> > pls help
> >
> You have to sign the applet.
> See those threads:
>
> http://faq.javaranch.com/java/HowCanAnAppletReadFilesOnTheLocalFileSystem
>
> http://www.developer.com/java/other/article.php/3303561/Creating-a-Trusted-Applet-with-Local-File-System-Access-Rights.htm
>
> Michèle Garoche
> > Somnath B Lohar
>
> --
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]<javaprogrammingwithpassion%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/javaprogrammingwithpassion?hl=en




-- 
Atentamente

Alfonso Bullon Vallejo

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en

Reply via email to