aspose file tools*
The moose likes JNLP and Web Start and the fly likes Properties files in JNLP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Properties files in JNLP" Watch "Properties files in JNLP" New topic
Author

Properties files in JNLP

Jossey Jacob
Greenhorn

Joined: Jul 30, 2008
Posts: 4
Can we add a properties file as a resource in JNLP

<jnlp>
....
<resources>
<j2se version="1.5+"/>
<jar href="client/abc.jar"/>

<!-- Is this possible -->
<jar href="client/client.properties"/>

</resources>
<application-desc main-class="MyMain"/>
</jnlp>

Or is there any other way?


Jossey
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18651
    
    8

I looked in the documentation. For the <jar> element it says "Specifies a JAR file that is part of the application's classpath".

So, that answers the first part of your question, I think. For the second question: is there any other way to do what? What problem were you trying to solve with that idea?
Jossey Jacob
Greenhorn

Joined: Jul 30, 2008
Posts: 4
Thanks for your reply. Sorry for my late reply.

We had this config file which contains the connection-properties for the client to connect to the server.
We are using rmi over http.
So the properties are like

connection.protocol =.....
connection.port=....
connection.hostname=...
etc...


These are like defined deployment time at deployment time. So we wanted to be able to specify these properties in a file in the server. This file will not be in a jar. And we wanted this file to be downloaded to the client via java web-start.

====================
Thats the whole story in short.

Now 2 Qs,
1. What is suitable approach in this scenario?
2. Is there a way to download any other than jar, zip.. like .exe, .xml files?
Yves Zoundi
Ranch Hand

Joined: Aug 31, 2008
Posts: 47
What is preventing you from downloading the file at the application startup?

if(!propertiesFile.exists()){
download("http://server/propertiesFile", configurationDirectory);
}

read(propertiesFile);


Author of VFSJFileChooser and XPontus XML Editor
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

Originally posted by Jossey Jacob:

Now 2 Qs,
1. What is suitable approach in this scenario?
2. Is there a way to download any other than jar, zip.. like .exe, .xml files?


You don't really need a properties file. You can define the properties in the jnlp file itself.

Something like this


From your application, you can retrieve these by making the call


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
 
subject: Properties files in JNLP