lib/java_buildpack/util/cache/download_cache.rb
# Creates an instance of the cache that is backed by a number of filesystem locations.  The first argument
# (+mutable_cache_root+) is the only location that downloaded files will be stored in.
#
# @param [Pathname] mutable_cache_root the filesystem location in which find cached files in.  This will also be
#                                      the location that all downloaded files are written to.
# @param [Pathname] immutable_cache_roots other filesystem locations to find cached files in.  No files will be
#                                         written to these locations.
Creates an instance of the cache that is backed by a number of filesystem locations.  The first argument
(+mutable_cache_root+) is the only location that downloaded files will be stored in.
Creates an instance of the cache that is backed by a number of filesystem locations . The first argument ( + mutable_cache_root + ) is the only location that downloaded files will be stored in .
def cache_content(response, cached_file)
          cached_file.cached(File::CREAT | File::WRONLY | File::BINARY) do |f|
            @logger.debug { "Persisting content to #{f.path}" }
            f.truncate(0)
            response.read_body { |chunk| f.write chunk }
            f.fsync
          end
          validate_size response['Content-Length'], cached_file
        end
def cache_content ( response , cached_file ) cached_file . cached ( File :: CREAT | File :: WRONLY | File :: BINARY ) do | f | @logger . debug { "Persisting content to #{f.path}" } f . truncate ( 0 ) response . read_body { | chunk | f . write chunk } f . fsync end validate_size response [ 'Content-Length' ] , cached_file end
Creates an instance of the cache that is backed by a number of filesystem locations.
Creates an instance of the cache that is backed by a number of filesystem locations .
response
cached_file
immutable_cache_roots other filesystem locations to find cached files in. No files will be written to these locations.
immutable_cache_roots other filesystem locations to find cached files in . No files will be written to these locations .