Hi everyone,

I am using webstart on some of my projects and I have had the need to
locally duplicate a webstart installed application. 

It means that taking an URL pointing to a JNLP, our code grabs all the jars
mentioned in the JNLP, copies them locally in some dir and start jetty to
serve them.

The reason for this need is performance. Webstart is extremely not
performant when it comes to checking file timestamps and takes foreover on
big installation and/or slow links (we have something like 40 jars and on a
slow link it takes 5 minutes just to check that there is no new version).

I was wondering whether this was a general need and whether there would be
an interest of adding this goal to the JNLP plugin or starting a webstart
plugin (I have a few other ideas, like using vamphq to perform webstart
operations but that would be for later).

I don't have any issue keeping this code private if you think there is no
general interest for this.

FYI, here's the code snippet (variable names will be adapted of course):

<!-- Create the folder where the application should be downloaded -->
<mkdir dir="${maven.ast.webapp.location}"/>

<!-- Get the jnlp file from the remote location. This file contains a list
     of all the jars needed to run the Client application -->
<get src="${maven.abbot.remotejnlp}"
    dest="${maven.ast.webapp.location}/${maven.ast.jnlp.name}"/>

<!-- Parse the jnlp file. Get all the jars from the remote location and
     store them in the folder created above -->
<u:file var="inputFile" 
    name="${maven.ast.webapp.location}/${maven.ast.jnlp.name}"/>
  <x:parse var="parsedfile" xml="${inputFile}"/>
  <x:set var="codeBaseName" select="string($parsedfile/jnlp/@codebase)"/>
  <x:forEach var="jar" select="$parsedfile/jnlp/resources/jar">
    <x:set var="jarName" select="string($jar/@href)"/>
    <get src="${codeBaseName}/${jarName}" usetimestamp="true"
        dest="${maven.ast.webapp.location}/${jarName}"/>
  </x:forEach>

<!-- Start Jetty in a separate thread so that the remaining script can be
     executed -->
<j:thread>
  <attainGoal name="jetty:run"/>
</j:thread>

Thanks
-Vincent


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to