def write_jnlp(options={})
      dir = options[:dir] || '.'
      path = options[:path] || @path.gsub(/^\//, '')
      Dir.chdir(dir) do
        FileUtils.mkdir_p(File.dirname(path))
        File.open(path, 'w') {|f| f.write to_jnlp(options[:jnlp]) }
        if options[:snapshot]
          snapshot_path = "#{File.dirname(path)}/#{@family}.jnlp"
          File.open(snapshot_path, 'w') {|f| f.write to_jnlp(options[:jnlp]) }
          current_version_path = "#{File.dirname(path)}/#{@family}-CURRENT_VERSION.txt"
          File.open(current_version_path, 'w') {|f| f.write @version_str }
        end
      end
    end
def write_jnlp(options={})
      dir = options[:dir] || '.'
      path = options[:path] || @path.gsub(/^\//, '')
      Dir.chdir(dir) do
        FileUtils.mkdir_p(File.dirname(path))
        File.open(path, 'w') {|f| f.write to_jnlp(options[:jnlp]) }
        if options[:snapshot]
          snapshot_path = "#{File.dirname(path)}/#{@family}.jnlp"
          File.open(snapshot_path, 'w') {|f| f.write to_jnlp(options[:jnlp]) }
          current_version_path = "#{File.dirname(path)}/#{@family}-CURRENT_VERSION.txt"
          File.open(current_version_path, 'w') {|f| f.write @version_str }
        end
      end
    end
Writes a local copy of the original jnlp .

 Writes jnlp to path of original jnlp into current working directory.
 A number of options can be passed modify the result.

 Example:

   server = 'http://localhost:4321'
   jnlp_cache = 'jnlp'
   new_href = "#{server}#{jnlp.path}"
   jnlp.write_jnlp( { :dir => jnlp_cache, :jnlp => { :codebase => server, :href => new_href }, :snapshot => true } )

 Writes a duplicate of the remote jnlp to a local path rooted at 'jnlp/'.
 With the codebase and href re-written referencing: 'http://localhost:4321'

 In addition a duplicate of the versioned jnlp is written without the version string as a snapshot
 jnlp and the version string is written to this file:

   jnlp-name-CURRENT_VERSION.txt