lib/liberty_buildpack/container/liberty.rb
# This method unpacks an archive file. Supported archive types are .zip, .jar, tar.gz and tgz.
# WARNING: Do not use this method to download archive files that should not be unzipped, such as client driver jars.
# For each downloaded file, there is a corresponding cached, etag, last_modified, and lock extension.
This method unpacks an archive file. Supported archive types are .zip, .jar, tar.gz and tgz.
WARNING: Do not use this method to download archive files that should not be unzipped, such as client driver jars.
For each downloaded file, there is a corresponding cached, etag, last_modified, and lock extension.
This method unpacks an archive file . Supported archive types are . zip . jar tar . gz and tgz . WARNING : Do not use this method to download archive files that should not be unzipped such as client driver jars . For each downloaded file there is a corresponding cached etag last_modified and lock extension .
def download_and_unpack_archive(uri, root)
      if uri.end_with?('.tgz', '.tar.gz', '.zip', 'jar')
        if uri.include? '://'
          print "-----> Downloading from #{uri} ... "
        else
          filename = File.basename(uri)
          print "-----> Retrieving #{filename} ... "
        end
        download_start_time = Time.now
        LibertyBuildpack::Util::ApplicationCache.new.get(uri) do |file|
          puts "(#{(Time.now - download_start_time).duration})"
          install_archive(file, uri, root)
        end
      else
        print("Unknown file type, not downloaded, at #{uri}\n")
      end
      print("\n")
    end
def download_and_unpack_archive ( uri , root ) if uri . end_with? ( '.tgz' , '.tar.gz' , '.zip' , 'jar' ) if uri . include? '://' print "-----> Downloading from #{uri} ... " else filename = File . basename ( uri ) print "-----> Retrieving #{filename} ... " end download_start_time = Time . now LibertyBuildpack :: Util :: ApplicationCache . new . get ( uri ) do | file | puts "(#{(Time.now - download_start_time).duration})" install_archive ( file , uri , root ) end else print ( "Unknown file type, not downloaded, at #{uri}\n" ) end print ( "\n" ) end
This method unpacks an archive file.
This method unpacks an archive file .
# all file types filtered here should be handled inside block. # shouldn't happen, expect index.yml or component_index.yml to always # name files that can be handled here.
uri
<not_specific>
root
<not_specific>