[6335] in java-interest

home help back first fref pref prev next nref lref last post

Re: File Security Exceptions in Java

daemon@ATHENA.MIT.EDU (Jeff Marin)
Fri Mar 29 14:47:16 1996

Date:         Mon, 18 Mar 1996 23:16:56 -0500
Reply-To: Java Interest <JAVA-INTEREST@JAVASOFT.COM>
From: Jeff Marin <jmarin@MARS.SUPERLINK.NET>
To: Multiple recipients of list JAVA-INTEREST
              <JAVA-INTEREST@JAVASOFT.COM>

Alan Masters wrote:
>
> Please could you help ?
>
> I am attempting to develop an application that reads and writes to a database
> on a locally networked Sun server.
>
> I have executed code including the following snippet, using the JDK 1.0
> appletviewer, as Netscape Navigator 2.0 does not produce any apparent result
>
> Produces file dialogue box }    FileDialog fd = new FileDialog ( this, "FD" );
>                            }    fd.show ();
>
> Shows selected directory   }    string = fd.getFile ();
> and file                   }    System.out.println ( string );
>                            }    string = fd.getDirectory ();
>                            }    System.out.println ( string );
>
>                                 File dir = new File ( string );
> Produces the exception     }    if ( dir.exists () )
> message below              }    {
>                                         System.out.println ("Dir exists");
>                                 }
>
>     *** Security Exception: file.read:/home/amast/Java/experiment/ ***
>     sun.applet.AppletSecurityException: security.file.read:
>       /home/amast/Java/experiment/
>         at sun.applet.AppletSecurity.checkRead(AppletSecurity.java:266)
>         at sun.applet.AppletSecurity.checkRead(AppletSecurity.java:237)
>         at java.io.File.exists(File.java)
>
> I suspect that it is a Systems Administration issue, and would be grateful if
> anybody could refer me to some on-line documentation describing what might
> be required,
> so that I could pass this on to the Systems team.
>
>         Many thanks,    Alan Masters.

Java security disallows all local file operations within applets
including checking for existance.  Try using a stand-alone app instead.
--
************************************************************************Jeff Marin                              jmarin@superlink.com
@Work Technologies                      http://www.worktechs.com
< "To err is human, to not learn JAVA mentally healthy but unavoidable!"
>

-----
This message has been forwarded via the JAVA-INTEREST
mailing list.  In order to unsubscribe from this list, send a message to
listserv@javasoft.com with the command 'signoff JAVA-INTEREST' in
the message body (not in the subject line).

-----
This message has been forwarded via the JAVA-INTEREST
mailing list.  In order to unsubscribe from this list, send a message to
listserv@javasoft.com with the command 'signoff JAVA-INTEREST' in
the message body (not in the subject line).

home help back first fref pref prev next nref lref last post