def import_jnlp(url=@url)
      @name = File.basename(url)
      #
      # @local_jnlp_href and @local_jnlp_name are only placeholders
      # values so far-- they will become valid when a local jnlp file
      # is written to the filesystem with this method:
      #
      #   Jnlp#write_local_jnlp
      #
      @local_jnlp_name = "local-#{@name}"
      @local_jnlp_href = File.expand_path("#{Dir.pwd}/#{@local_jnlp_name}")
      @jnlp = Nokogiri::XML(open(url).read)
      @spec = (@jnlp/"jnlp").attr('spec').value
      @codebase = (@jnlp/"jnlp").attr('codebase').value
      @path = @url.gsub(@codebase, '')
      @family = File.basename(File.dirname(@path))
      @href = (@jnlp/"jnlp").attr('href').value unless (@jnlp/"jnlp").attr('href').nil?
      @title, @vendor, @homepage, @description, @icon = nil, nil, nil, nil, nil
      unless (info = (@jnlp/"information")).empty?
        @title = (info/"title").inner_html.strip
        @vendor = (info/"vendor").inner_html.strip
        @homepage = (info/"homepage").empty? ? '' : (info/"homepage").attr('href').value
        @description = (info/"description").empty? ? '' : (info/"description").inner_html.strip
        icon = (info/"icon")
        @icon = Icon.new(icon) unless icon.empty?
        @offline_allowed = (info/"offline-allowed") ? true : false
      end
      @main_class = (@jnlp/"application-desc").attr('main-class').value
      @argument = (@jnlp/"argument").inner_html.strip
      @j2ses, @properties, @jars, @nativelibs = [], [], [], []
      (@jnlp/"resources").each do |resources|
        if os = resources[:os]
          os = os.strip.downcase.gsub(/\W+/, '_').gsub(/^_+|_+$/, '')
        end
        if arch = resources[:arch]
          arch = arch.strip.downcase.gsub(/\W+/, '_').gsub(/^_+|_+$/, '')
        end
        (resources/"j2se").each { |j2se| @j2ses << J2se.new(j2se, os, arch) }
        (resources/"property").each { |prop| @properties << Property.new(prop, os) }
        (resources/"jar").each { |res| @jars << Resource.new(res, @codebase, os) }
        (resources/"nativelib").each { |res| @nativelibs << Resource.new(res, @codebase, os) }
      end
      maven_jnlp_version = properties.find {|p| p.name == "maven.jnlp.version"}
      if maven_jnlp_version
        @version_str = maven_jnlp_version.value[/#{@family}-(.*)/, 1]
      end
      if @local_cache_dir
        cache_resources(@local_cache_dir)
        generate_local_jnlp
      end
    end
def import_jnlp(url=@url)
      @name = File.basename(url)
      #
      # @local_jnlp_href and @local_jnlp_name are only placeholders
      # values so far-- they will become valid when a local jnlp file
      # is written to the filesystem with this method:
      #
      #   Jnlp#write_local_jnlp
      #
      @local_jnlp_name = "local-#{@name}"
      @local_jnlp_href = File.expand_path("#{Dir.pwd}/#{@local_jnlp_name}")
      @jnlp = Nokogiri::XML(open(url).read)
      @spec = (@jnlp/"jnlp").attr('spec').value
      @codebase = (@jnlp/"jnlp").attr('codebase').value
      @path = @url.gsub(@codebase, '')
      @family = File.basename(File.dirname(@path))
      @href = (@jnlp/"jnlp").attr('href').value unless (@jnlp/"jnlp").attr('href').nil?
      @title, @vendor, @homepage, @description, @icon = nil, nil, nil, nil, nil
      unless (info = (@jnlp/"information")).empty?
        @title = (info/"title").inner_html.strip
        @vendor = (info/"vendor").inner_html.strip
        @homepage = (info/"homepage").empty? ? '' : (info/"homepage").attr('href').value
        @description = (info/"description").empty? ? '' : (info/"description").inner_html.strip
        icon = (info/"icon")
        @icon = Icon.new(icon) unless icon.empty?
        @offline_allowed = (info/"offline-allowed") ? true : false
      end
      @main_class = (@jnlp/"application-desc").attr('main-class').value
      @argument = (@jnlp/"argument").inner_html.strip
      @j2ses, @properties, @jars, @nativelibs = [], [], [], []
      (@jnlp/"resources").each do |resources|
        if os = resources[:os]
          os = os.strip.downcase.gsub(/\W+/, '_').gsub(/^_+|_+$/, '')
        end
        if arch = resources[:arch]
          arch = arch.strip.downcase.gsub(/\W+/, '_').gsub(/^_+|_+$/, '')
        end
        (resources/"j2se").each { |j2se| @j2ses << J2se.new(j2se, os, arch) }
        (resources/"property").each { |prop| @properties << Property.new(prop, os) }
        (resources/"jar").each { |res| @jars << Resource.new(res, @codebase, os) }
        (resources/"nativelib").each { |res| @nativelibs << Resource.new(res, @codebase, os) }
      end
      maven_jnlp_version = properties.find {|p| p.name == "maven.jnlp.version"}
      if maven_jnlp_version
        @version_str = maven_jnlp_version.value[/#{@family}-(.*)/, 1]
      end
      if @local_cache_dir
        cache_resources(@local_cache_dir)
        generate_local_jnlp
      end
    end
Rebuild the Jnlp by loading and parsing the Java Web Start
 Jnlp located at _path_ -- _path_ can be a local path or a url.

 If @local_cache_dir is set then the cache directory wll be updated also.

 If @include_pack_gz is set then the gzipped pack200 versions of the resources
 will be cached also.