Where to save files from a signed Applet

Discussion in 'Java' started by Murph, Jul 18, 2005.

  1. Murph

    Murph Guest

    I have an applet and I will be asking the user to allow it to write to
    their computer. This is more to store files so that they will not have
    to download the same files everytime the visit. The user base is very
    small at this time (6 people).

    The questions I have are:
    Is it possible, for me to save the files to the current browser's
    cashe. I want to do this so the browser will clear out stale files. I
    don't want to leave garbage on the users HD if they stop useing this
    applet for an extended time.

    Once I leave the files, how can I determine where they are on the
    return. I'm assuming that if I can get the browser's cashe location I
    can read and write to that directory.

    Any problems with this? I'm trying to be a good citizen by not
    polluting the users HD.
    Murph, Jul 18, 2005
    #1
    1. Advertising

  2. On 18 Jul 2005 15:24:26 -0700, Murph wrote:

    > I have an applet and I will be asking the user to allow it to write to
    > their computer. This is more to store files so that they will not have
    > to download the same files everytime the visit.


    What files? Images? Text files? Classes?
    Files that the end user is editing or creating?

    .....
    > I'm trying to be a good citizen by not
    > polluting the users HD.


    Probably* the best way to do this is to use JWS.

    You can specify the resource files as 'lazy' download,
    so the user only downmloads them as and when needed.

    JWS itself can manage both the file storage and access,
    automatically update both the applet classes and resources,
    and offers the user an 'uninstall' facility - which should
    neatly rid you of any responsibility for tidying up the end
    user's disk space.

    * That depends on further answers as to the nature
    of the resources.

    --
    Andrew Thompson
    physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
    LOADING....
    Andrew Thompson, Jul 18, 2005
    #2
    1. Advertising

  3. Murph

    Roedy Green Guest

    On 18 Jul 2005 15:24:26 -0700, "Murph" <> wrote or
    quoted :

    >I have an applet and I will be asking the user to allow it to write to
    >their computer. This is more to store files so that they will not have
    >to download the same files everytime the visit. The user base is very
    >small at this time (6 people).
    >
    >The questions I have are:
    >Is it possible, for me to save the files to the current browser's
    >cashe. I want to do this so the browser will clear out stale files. I
    >don't want to leave garbage on the users HD if they stop useing this
    >applet for an extended time.
    >
    >Once I leave the files, how can I determine where they are on the
    >return. I'm assuming that if I can get the browser's cashe location I
    >can read and write to that directory.
    >
    >Any problems with this? I'm trying to be a good citizen by not
    >polluting the users HD.


    This is the difficult problem. Sun offers no help. All you can do is
    poke around in the system properties for clues, or sniff the hard disk
    yourself. see http://mindprod.com/applets/wassup.html

    user.home = C:\Documents and Settings\Administrator.ROEDY

    java.home = C:\Program Files\Java\jre1.5.0_04


    java.library.path = E:\Program
    Files\Opera8;.;C:\WINNT\system32;C:\WINNT;c:\BAT;c:\ENV;c:\SYS;c:\WINNT;c:\WINNT\SYSTEM32;
    c:\WINNT\SYSTEM32\WBEM;e:\apache-ant-1.6.5\bin\;e:\JET\BIN;e:\VSLICK\WIN;e:\Program
    Files\JAVA\JDK1.5.0_04\BIN;e:\Program Files\010Editor;e:\Program
    Files\COMMON FILES\ADAPTEC SHARED\SYSTEM;e:\Program Files\Microsoft
    Visual Studio\Common\MSDev98\Bin;e:\Program Files\Microsoft Visual
    Studio\Common\Tools;e:\Program Files\Microsoft Visual
    Studio\Common\Tools\WinNT;e:\Program Files\Microsoft Visual
    Studio\VC98\bin;e:\Program Files\Microsoft Visual
    Studio\VC98\bin;E:\Program Files\Microsoft Visual
    Studio\Common\Tools\WinNT;E:\Program Files\Microsoft Visual
    Studio\Common\MSDev98\Bin;E:\Program Files\Microsoft Visual
    Studio\Common\Tools;E:\Program Files\Microsoft Visual Studio\VC98\bin



    With JAWS, Java will assign you a corner of the disk tree to use, and
    it will clear it on uninstall.


    In a pinch you can always use the current directory and only use
    temporary files. I don't like Sun's temporary file creator because the
    files created aro not obviously temporary, and might not eventually be
    scavenged.

    In the Replicator (see http://mindprod.com/applets/replicator.html) I
    ask the user to assign me two permanent directories for my use. I
    give him a fileChooser to select them. These are directories I want to
    user to poke around in also. If I wanted some secret hiding space I
    would have used the JAWS directory hidden way off in the nether
    regions of documents and settings on an already overcrowded C: drive.


    --
    Bush crime family lost/embezzled $3 trillion from Pentagon.
    Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
    http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

    Canadian Mind Products, Roedy Green.
    See http://mindprod.com/iraq.html photos of Bush's war crimes
    Roedy Green, Jul 19, 2005
    #3
  4. Murph

    Murph Guest

    Thanks for responding Andrew, you've always been helpfull.

    The files that I want to store are image files. The reason I want to
    store them locally is to reduce bandwidth. State information will be
    stored on the server. I didn't think of using JWS. I wanted to make the
    applet as simple as possible.
    Murph, Jul 19, 2005
    #4
  5. Murph

    Murph Guest

    Roedy-

    Thanks for the info and for the site. It's always been one of my Java
    resources. Glade to see you returned to the newsgroup.

    Mark
    Murph, Jul 19, 2005
    #5
  6. On 19 Jul 2005 00:12:25 -0700, Murph wrote:

    > Thanks for responding Andrew, you've always been helpfull.


    You're welcome.

    > The files that I want to store are image files. The reason I want to
    > store them locally is to reduce bandwidth. State information will be
    > stored on the server. I didn't think of using JWS. I wanted to make the
    > applet as simple as possible.


    Using JWS does not have to be complicated, in this case,
    the applet does *not* need to be signed.

    Simply jar your applet classes and (separately) your image files
    (broken into a number of zip archives - if that makes sense) then
    specify the jar file as 'eager' downlaod and each of the image archives
    as 'lazy'. It has pretty much the effect you are after.

    --
    Andrew Thompson
    physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
    Now Interactive! Joystick Controls Fry's Left Ear.
    Andrew Thompson, Jul 19, 2005
    #6
    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. webster
    Replies:
    0
    Views:
    843
    webster
    Jul 20, 2003
  2. Hansi
    Replies:
    10
    Views:
    4,014
    Mickey Segal
    Feb 15, 2007
  3. kyrpa83
    Replies:
    1
    Views:
    616
    kyrpa83
    Oct 17, 2007
  4. markspace
    Replies:
    0
    Views:
    360
    markspace
    Jul 6, 2009
  5. Rob1bureau
    Replies:
    1
    Views:
    799
    joris
    Feb 27, 2010
Loading...

Share This Page