lib/geoblacklight/metadata/base.rb
def retrieve_metadata
        connection = Faraday.new(url: @reference.endpoint) do |conn|
          conn.use FaradayMiddleware::FollowRedirects
          conn.adapter Faraday.default_adapter
        end
        begin
          response = connection.get
          return response.body unless response.nil? || response.status == 404
          Geoblacklight.logger.error "Could not reach #{@reference.endpoint}"
          ''
        rescue Faraday::ConnectionFailed, Faraday::TimeoutError, OpenSSL::SSL::SSLError => error
          Geoblacklight.logger.error error.inspect
          ''
        end
      end
##
# Retrieves metadata from a url source
# @return [String, nil] metadata string or nil if there is a
# connection error
Retrieves metadata from a url source
Retrieves metadata from a url source
def retrieve_metadata
        connection = Faraday.new(url: @reference.endpoint) do |conn|
          conn.use FaradayMiddleware::FollowRedirects
          conn.adapter Faraday.default_adapter
        end
        begin
          response = connection.get
          return response.body unless response.nil? || response.status == 404
          Geoblacklight.logger.error "Could not reach #{@reference.endpoint}"
          ''
        rescue Faraday::ConnectionFailed, Faraday::TimeoutError, OpenSSL::SSL::SSLError => error
          Geoblacklight.logger.error error.inspect
          ''
        end
      end
def retrieve_metadata connection = Faraday . new ( url : @reference . endpoint ) do | conn | conn . use FaradayMiddleware :: FollowRedirects conn . adapter Faraday . default_adapter end begin response = connection . get return response . body unless response . nil? || response . status == 404 Geoblacklight . logger . error "Could not reach #{@reference.endpoint}" '' rescue Faraday :: ConnectionFailed , Faraday :: TimeoutError , OpenSSL :: SSL :: SSLError => error Geoblacklight . logger . error error . inspect '' end end
Retrieves metadata from a url source
Retrieves metadata from a url source
metadata string or nil if there is a connection error
metadata string or nil if there is a connection error
String, nil