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 / October 2007

Tip: Looking for answers? Try searching our database.

Deploying with JWS Where to put locally created files?

Thread view: 
Lionel van den Berg - 29 Oct 2007 13:37 GMT
I'm looking at using JWS to deploy an app that I previously created a
traditional installer for.

My first thoughts were that I wanted to install all the files and
directories in the apps own install directory but then I discovered that
is not the way JWS works. That seems ok, but what about files that I
want to create on the local computer like logs. At the moment the
working directory appears to be the Desktop!!!! So I make crap appear on
the desktop!

I could easily choose a directory like .myapp in /home/lionel or in
C:\Documents and Settings\lionel\Application Data\MyApp but that
requires OS specific information.

Is there some way I can get an appropriate directory in a cross-platform
manner? I want this to be a sensible directory so that the user can find
it fairly easily if I need them to.

I'm also disappointed to discover that desktop shortcuts are not
supported for any OS other than windows!

Thanks

Lionel.
Andrew Thompson - 29 Oct 2007 14:00 GMT
>I'm looking at using JWS to deploy an app that I previously created a
>traditional installer for.
...
>Is there some way I can get an appropriate directory in a cross-platform
>manner? I want this to be a sensible directory so that the user can find
>it fairly easily if I need them to.

class SomePoperties {
 public static void main(String[] args) {
   System.out.println( System.getProperty("java.io.tmpdir") );
   System.out.println( System.getProperty("user.home") );
 }
}

If using user.home, it would be best to put the
application specific data in a sub-directory based
on the main class package name,  to help avoid
overwriting data from any other app.!

For a sandboxed web start app., you might look to
storing information using the PersistenceService*,
and if the user wants access to it, export it using the
FileSaveService**, to whereever the user desires.

* <http://www.physci.org/jws/#ps>
** <http://www.physci.org/jws/#fs>

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Lionel van den Berg - 30 Oct 2007 12:06 GMT
>> I'm looking at using JWS to deploy an app that I previously created a
>> traditional installer for.
[quoted text clipped - 22 lines]
> * <http://www.physci.org/jws/#ps>
> ** <http://www.physci.org/jws/#fs>

It is a sandbox app so I'll look into your suggestions. Thanks.

Lionel.
Stefan Ram - 29 Oct 2007 14:00 GMT
>Is there some way I can get an appropriate directory in a cross-platform

 If you want to find a generalization of the user's home
 directory:

 The call »java.lang.System.getProperty( "user.home" )« does
 not always deliver what the name »user.home« promises
 (to make a long story short).  

 I did some investigations recently and found that the best
 portable way to get the user's home directory might be:

http://download.java.net/jdk7/docs/api/javax/swing/filechooser/FileSystemView.ht
ml#getDefaultDirectory
()

 You also might have a look at the other directory paths
 given as system properties.


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.