org.formaria.deploy
Class JnlpResourceLoader

java.lang.Object
  extended by org.formaria.deploy.JnlpResourceLoader

public class JnlpResourceLoader
extends java.lang.Object

A dynamic loader of resources via the JNLP API.

Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.


Constructor Summary
JnlpResourceLoader(java.net.URL base)
          Creates a new instance of JnlpResourceLoader
 
Method Summary
 boolean loadResource(java.lang.String res, java.lang.String version)
          Load the specified resource, blocking till the download is complete
 boolean loadResource(java.lang.String res, java.lang.String version, boolean clear)
          Load the specified resource, blocking till the download is complete
 void setBaseUrl(java.net.URL base)
          Set the base URL for the download service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JnlpResourceLoader

public JnlpResourceLoader(java.net.URL base)
Creates a new instance of JnlpResourceLoader

Parameters:
base - the basic URL to which resoruce names wil be appended
Method Detail

setBaseUrl

public void setBaseUrl(java.net.URL base)
Set the base URL for the download service.

Parameters:
base - the basic URL to which resoruce names wil be appended

loadResource

public boolean loadResource(java.lang.String res,
                            java.lang.String version)
Load the specified resource, blocking till the download is complete

Parameters:
res - the resource name. The name will be appended to the base url to get the complete download URL.
version - the version to download or null if the version is not used
Returns:
true if the download completes successfully.

loadResource

public boolean loadResource(java.lang.String res,
                            java.lang.String version,
                            boolean clear)
Load the specified resource, blocking till the download is complete

Parameters:
res - the resource name. The name will be appended to the base url to get the complete download URL.
version - the version to download or null if the version is not used
clear - clear the cache before downloading. If this is true then the resource will always be downloded, otherwise the cachced resource will be returned if it is present.
Returns:
true if the download completes successfully.