lib/liberty_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 validate_size(expected_size, cached_file)
          return unless expected_size
          actual_size = cached_file.cached(File::RDONLY, &:size)
          @logger.debug { "Validated content size #{actual_size} is #{expected_size}" }
          return if expected_size.to_i == actual_size
          cached_file.destroy
          raise InferredNetworkFailure, "Content has invalid size.  Was #{actual_size}, should be #{expected_size}."
        end
def validate_size ( expected_size , cached_file ) return unless expected_size actual_size = cached_file . cached ( File :: RDONLY , & :size ) @logger . debug { "Validated content size #{actual_size} is #{expected_size}" } return if expected_size . to_i == actual_size cached_file . destroy raise InferredNetworkFailure , "Content has invalid size.  Was #{actual_size}, should be #{expected_size}." 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 .
expected_size
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 .