def do_copy_out(path_map)
      path_map.each do |src_path, dst_path|
        # constraining the generated 'metadata.json' size is debatable, but
        # our UI attempts to load metadata JSON into memory far too often to
        # be blasé about generating multi-megabyte JSON files.
        unless ::File.file?(src_path)
          raise MetadataError, "Expected generated file was not found: #{src_path}"
        end
        src_size = ::File.stat(src_path).size
        if src_size <= FREED_FILE_SIZE_CONSTRAINT
          ::FileUtils.mkdir_p(::File.dirname(dst_path))
          ::FileUtils.cp(src_path, dst_path)
        else
          raise MetadataError,
                "Generated file size of" +
                " #{src_size / 1024} KB" +
                " exceeded the allowed limit of" +
                " #{FREED_FILE_SIZE_CONSTRAINT / 1024} KB"
        end
      end
      true
    end
def do_copy_out(path_map)
      path_map.each do |src_path, dst_path|
        # constraining the generated 'metadata.json' size is debatable, but
        # our UI attempts to load metadata JSON into memory far too often to
        # be blasé about generating multi-megabyte JSON files.
        unless ::File.file?(src_path)
          raise MetadataError, "Expected generated file was not found: #{src_path}"
        end
        src_size = ::File.stat(src_path).size
        if src_size <= FREED_FILE_SIZE_CONSTRAINT
          ::FileUtils.mkdir_p(::File.dirname(dst_path))
          ::FileUtils.cp(src_path, dst_path)
        else
          raise MetadataError,
                "Generated file size of" +
                " #{src_size / 1024} KB" +
                " exceeded the allowed limit of" +
                " #{FREED_FILE_SIZE_CONSTRAINT / 1024} KB"
        end
      end
      true
    end
copies files out of jail by mapping of jail to free path.