def get_resource(uri)
      clear
      uri = URI.parse(uri)
      @req = Net::HTTP::Get.new uri.request_uri
      set_common_info(@req)
      cache = @cache.get(uri.to_s)
      unless cache.nil?
        @req['If-Modified-Since'] = cache.last_modified unless cache.last_modified.nil?
        @req['If-None-Match'] = cache.etag unless cache.etag.nil?
      end
      @http_class.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
        @res = http.request(@req)
        case @res
          when Net::HTTPOK
            if Atom::MediaType::ENTRY.is_a?(@res['Content-Type'])
              @rc = Atom::Entry.new :stream => @res.body
            else
              @rc = @res.body
            end
            @cache.put uri.to_s, {
              :rc            => @rc,
              :last_modified => @res['Last-Modified'],
              :etag          => @res['ETag'] }
          when Net::HTTPNotModified
            unless cache.nil?
              @rc = cache.rc
            else
              raise CacheNotFoundError, "Got Not-Modified response, but has no cache."
            end
          else
            raise RequestError, "Failed to get content. #{@res.code}"
        end
      end
    end
def get_resource(uri)
      clear
      uri = URI.parse(uri)
      @req = Net::HTTP::Get.new uri.request_uri
      set_common_info(@req)
      cache = @cache.get(uri.to_s)
      unless cache.nil?
        @req['If-Modified-Since'] = cache.last_modified unless cache.last_modified.nil?
        @req['If-None-Match'] = cache.etag unless cache.etag.nil?
      end
      @http_class.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
        @res = http.request(@req)
        case @res
          when Net::HTTPOK
            if Atom::MediaType::ENTRY.is_a?(@res['Content-Type'])
              @rc = Atom::Entry.new :stream => @res.body
            else
              @rc = @res.body
            end
            @cache.put uri.to_s, {
              :rc            => @rc,
              :last_modified => @res['Last-Modified'],
              :etag          => @res['ETag'] }
          when Net::HTTPNotModified
            unless cache.nil?
              @rc = cache.rc
            else
              raise CacheNotFoundError, "Got Not-Modified response, but has no cache."
            end
          else
            raise RequestError, "Failed to get content. #{@res.code}"
        end
      end
    end
Get resouces(entry or media)