Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Where to save files from a signed Applet

Reply
Thread Tools

Where to save files from a signed Applet

 
 
Murph
Guest
Posts: n/a
 
      07-18-2005
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.

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      07-18-2005
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....
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      07-19-2005
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/...s_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 
Reply With Quote
 
Murph
Guest
Posts: n/a
 
      07-19-2005
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.

 
Reply With Quote
 
Murph
Guest
Posts: n/a
 
      07-19-2005
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

 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      07-19-2005
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert a signed binary number into a signed one ? Rob1bureau VHDL 1 02-27-2010 12:13 AM
Re: how load properites files to applet without signed... markspace Java 0 07-06-2009 02:36 PM
signed(12 downto 0) to signed (8 downto 0) kyrpa83 VHDL 1 10-17-2007 06:58 PM
Access to local files with signed applet in Vista/IE7 Hansi Java 10 02-15-2007 04:13 PM
Re: play wave files using java.applet.Applet webster Java 0 07-20-2003 01:51 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57