This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Properties files in JNLP

 
Jossey Jacob
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Paul Clapham
Sheriff
Pie
Posts: 20185
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is preventing you from downloading the file at the application startup?

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

read(propertiesFile);
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic