Applet and policy file questions

Discussion in 'Java' started by Neil Cherry, Jan 18, 2004.

  1. Neil Cherry

    Neil Cherry Guest

    I'm writing an applet (Java 1.4.2) that needs to read one file and
    write to another file on the user's PC. I've created a test applet and
    I've run it through appletviewer and it works fine. When I run it
    through Firebird (I'm using the javaplugin) I get an exception when I
    attempt to write to the file (same applet that worked with
    appletviewer).

    I have a .java.policy in my $HOME directory and in
    ~/.java/deployment/security/java.policy and
    ~/.java/deployment/security/.java.policy (same file copied to 3
    different places). I have a file called foo and bar in my home
    directory and everyone has read and write permissions. Lastly this is
    my policy file:

    grant codeBase "file:." {
    permission java.io.FilePermission "foo", "read, write";
    permission java.io.FilePermission "bar", "write";
    };

    Any pointers? Also where would the file go if it were on a MAC or
    Windows 2K or XP machine?

    --
    Linux Home Automation Neil Cherry
    http://home.comcast.net/~ncherry/ (Text only)
    http://linuxha.sourceforge.net/ (SourceForge)
    http://hcs.sourceforge.net/ (HCS II)
     
    Neil Cherry, Jan 18, 2004
    #1
    1. Advertising

  2. "Neil Cherry" <> wrote in message
    news:...
    | I'm writing an applet (Java 1.4.2) that needs to read one file
    and
    | write to another file on the user's PC.
    .....
    | I have a .java.policy in my $HOME directory and in

    I thought the 'policy' files were very
    old hat and had been replaced by WebStart,
    but Sun has made documents that mention
    the policy file quite recently.

    But that was just a round-about way to get
    to my question. Had you considered
    delivering your app. through Webstart?

    Get that right and it should solve all security
    problems (well, ..for the developer anyway)

    --
    Andrew Thompson
    * http://www.PhySci.org/ PhySci software suite
    * http://www.1point1C.org/ 1.1C - Superluminal!
    * http://www.AThompson.info/andrew/ personal site
     
    Andrew Thompson, Jan 18, 2004
    #2
    1. Advertising

  3. Neil Cherry

    Neil Cherry Guest

    On Sun, 18 Jan 2004 21:49:29 GMT, Andrew Thompson wrote:
    > "Neil Cherry" <> wrote in message
    > news:...
    >| I'm writing an applet (Java 1.4.2) that needs to read one file
    >| and write to another file on the user's PC.
    > ....
    >| I have a .java.policy in my $HOME directory and in
    >
    > I thought the 'policy' files were very
    > old hat and had been replaced by WebStart,
    > but Sun has made documents that mention
    > the policy file quite recently.
    >
    > But that was just a round-about way to get
    > to my question. Had you considered
    > delivering your app. through Webstart?


    Hmm, didn't know about that, I'll go look up web start. I have it on
    one of my Windows boxes. I'll see if I can find it for Linux too.

    --
    Linux Home Automation Neil Cherry
    http://home.comcast.net/~ncherry/ (Text only)
    http://linuxha.sourceforge.net/ (SourceForge)
    http://hcs.sourceforge.net/ (HCS II)
     
    Neil Cherry, Jan 18, 2004
    #3
  4. "Neil Cherry" <> wrote in message
    news:...
    | On Sun, 18 Jan 2004 21:49:29 GMT, Andrew Thompson wrote:

    | ..I'll go look up web start.

    It should come standard with the latest
    Java. (So I'd be very surprised if it did
    not come with both Linux and Apple
    variants)

    --
    Andrew Thompson
    * http://www.PhySci.org/ PhySci software suite
    * http://www.1point1C.org/ 1.1C - Superluminal!
    * http://www.AThompson.info/andrew/ personal site
     
    Andrew Thompson, Jan 18, 2004
    #4
  5. Neil Cherry

    Neil Cherry Guest

    On Sun, 18 Jan 2004 23:31:19 GMT, Andrew Thompson wrote:
    > "Neil Cherry" <> wrote in message
    > news:...
    >| On Sun, 18 Jan 2004 21:49:29 GMT, Andrew Thompson wrote:
    >
    >| ..I'll go look up web start.
    >
    > It should come standard with the latest
    > Java. (So I'd be very surprised if it did
    > not come with both Linux and Apple
    > variants)


    According to Sun it's in the 1.4.2 JRE (I have j2sdk1.4.2_02 which
    should contain it). So far I know nothing about it but I just found
    the API and I'm looking around. Turns out I also upgrade 1 Win2K PC so
    I have it set up for Mozilla on 2 machines. On my other Windows
    machine I'll setup IE (ick!) to use Web Start. I'll probalby still
    have to figure out the policy issue since a few users may not be on
    Web Start.

    --
    Linux Home Automation Neil Cherry
    http://home.comcast.net/~ncherry/ (Text only)
    http://linuxha.sourceforge.net/ (SourceForge)
    http://hcs.sourceforge.net/ (HCS II)
     
    Neil Cherry, Jan 19, 2004
    #5
  6. Neil Cherry

    Neil Cherry Guest

    On Sun, 18 Jan 2004 20:06:39 -0600, Neil Cherry wrote:
    > On Sun, 18 Jan 2004 23:31:19 GMT, Andrew Thompson wrote:
    >> "Neil Cherry" <> wrote in message
    >> news:...
    >>| On Sun, 18 Jan 2004 21:49:29 GMT, Andrew Thompson wrote:
    >>
    >>| ..I'll go look up web start.
    >>
    >> It should come standard with the latest
    >> Java. (So I'd be very surprised if it did
    >> not come with both Linux and Apple
    >> variants)

    >
    > According to Sun it's in the 1.4.2 JRE (I have j2sdk1.4.2_02 which
    > should contain it). So far I know nothing about it but I just found


    I've done a bunch of poking around and JNLP (javaws) works half as
    good as the demo's I'll be on very happy camper. The files are tiny,
    which is real good because I need to rewrite a DOS Application and
    store it on the XPort (www.lantronics.com) which only gives me 64K
    of space to store the applet (JNLP?). Thanks for the info.

    --
    Linux Home Automation Neil Cherry
    http://home.comcast.net/~ncherry/ (Text only)
    http://linuxha.sourceforge.net/ (SourceForge)
    http://hcs.sourceforge.net/ (HCS II)
     
    Neil Cherry, Jan 19, 2004
    #6
  7. Neil Cherry

    Neil Cherry Guest

    On Sun, 18 Jan 2004 21:40:13 -0600, Neil Cherry wrote:
    > On Sun, 18 Jan 2004 20:06:39 -0600, Neil Cherry wrote:
    >> On Sun, 18 Jan 2004 23:31:19 GMT, Andrew Thompson wrote:
    >>> "Neil Cherry" <> wrote in message
    >>> news:...
    >>>| On Sun, 18 Jan 2004 21:49:29 GMT, Andrew Thompson wrote:
    >>>
    >>>| ..I'll go look up web start.



    >> According to Sun it's in the 1.4.2 JRE (I have j2sdk1.4.2_02 which
    >> should contain it). So far I know nothing about it but I just found

    >
    > I've done a bunch of poking around and JNLP (javaws) works half as
    > good as the demo's I'll be on very happy camper. The files are tiny,
    > which is real good because I need to rewrite a DOS Application and
    > store it on the XPort (www.lantronics.com) which only gives me 64K
    > of space to store the applet (JNLP?). Thanks for the info.


    Ignore the size comment, I was looking at the .jnlp file and not the
    ..jar file. Still very cool!


    --
    Linux Home Automation Neil Cherry
    http://home.comcast.net/~ncherry/ (Text only)
    http://linuxha.sourceforge.net/ (SourceForge)
    http://hcs.sourceforge.net/ (HCS II)
     
    Neil Cherry, Jan 19, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Krista
    Replies:
    3
    Views:
    2,358
    Andrew Thompson
    Sep 15, 2004
  2. Darol
    Replies:
    14
    Views:
    19,355
    Darol
    Aug 30, 2005
  3. Replies:
    3
    Views:
    431
  4. Willy Stevens

    Distributing java.policy with Applet.jar

    Willy Stevens, Oct 4, 2007, in forum: Java
    Replies:
    9
    Views:
    816
    Hunter Gratzner
    Oct 6, 2007
  5. Krist
    Replies:
    3
    Views:
    1,581
    Andrew Thompson
    May 15, 2010
Loading...

Share This Page