lib/browse_everything/driver/google_drive.rb
def list_files(drive, request_params, path: '')
        drive.list_files(request_params.to_h) do |file_list, error|
          # Raise an exception if there was an error Google API's
          if error.present?
            # In order to properly trigger reauthentication, the token must be cleared
            # Additionally, the error is not automatically raised from the Google Client
            @token = nil
            raise error
          end

          values = file_list.files.map do |gdrive_file|
            details(gdrive_file, path)
          end
          @entries += values.compact

          request_params.page_token = file_list.next_page_token
        end

        @entries += list_files(drive, request_params, path: path) if request_params.page_token.present?
      end
# Lists the files given a Google Drive context
# @param drive [Google::Apis::DriveV3::DriveService] the Google Drive context
# @param request_params [RequestParameters] the object containing the parameters for the Google Drive API request
# @param path [String] the path (default to the root)
# @return [Array<BrowseEverything::FileEntry>] file entries for the path
Lists the files given a Google Drive context
Lists the files given a Google Drive context
def list_files(drive, request_params, path: '')
        drive.list_files(request_params.to_h) do |file_list, error|
          if error.present?
            @token = nil
            raise error
          end
          values = file_list.files.map do |gdrive_file|
            details(gdrive_file, path)
          end
          @entries += values.compact
          request_params.page_token = file_list.next_page_token
        end
        @entries += list_files(drive, request_params, path: path) if request_params.page_token.present?
      end
def list_files ( drive , request_params , path : '' ) drive . list_files ( request_params . to_h ) do | file_list , error | if error . present? @token = nil raise error end values = file_list . files . map do | gdrive_file | details ( gdrive_file , path ) end @entries += values . compact request_params . page_token = file_list . next_page_token end @entries += list_files ( drive , request_params , path : path ) if request_params . page_token . present? end
Lists the files given a Google Drive context
Lists the files given a Google Drive context
# Raise an exception if there was an error Google API's # In order to properly trigger reauthentication, the token must be cleared # Additionally, the error is not automatically raised from the Google Client
file entries for the path
file entries for the path
Array<BrowseEverything::FileEntry>
drive
the Google Drive context
the Google Drive context
request_params
the object containing the parameters for the Google Drive API request
the object containing the parameters for the Google Drive API request
path
the path (default to the root)
the path ( default to the root )