Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2005

Tip: Looking for answers? Try searching our database.

Where to save files from a signed Applet

Thread view: 
Murph - 18 Jul 2005 23:24 GMT
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.
Andrew Thompson - 18 Jul 2005 23:44 GMT
> 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.

Signature

Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
LOADING....

Murph - 19 Jul 2005 08:12 GMT
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.
Andrew Thompson - 19 Jul 2005 10:48 GMT
> 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.

Signature

Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
Now Interactive!  Joystick Controls Fry's Left Ear.

Roedy Green - 19 Jul 2005 01:13 GMT
>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
[quoted text clipped - 13 lines]
>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.

Signature

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

Murph - 19 Jul 2005 08:20 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.