    # File lib/fog/aws/models/storage/file.rb, line 100
            def public_url
              requires :directory, :key
              if connection.get_object_acl(directory.key, key).body['AccessControlList'].detect {|grant| grant['Grantee']['URI'] == 'http://acs.amazonaws.com/groups/global/AllUsers' && grant['Permission'] == 'READ'}
                if directory.key.to_s =~ /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\-(?![\.])){1,61}[a-z0-9]$/
                  "https://#{directory.key}.s3.amazonaws.com/#{Fog::AWS.escape(key)}"
                else
                  "https://s3.amazonaws.com/#{directory.key}/#{Fog::AWS.escape(key)}"
                end
              else
                nil
              end
            end