app/controllers/concerns/deposit_data.rb
# given a google file id, a relative path for where it belongs, and a byte range, get the file data from google and write it
given a google file id, a relative path for where it belongs, and a byte range, get the file data from google and write it
given a google file id a relative path for where it belongs and a byte range get the file data from google and write it
def deposit_file_from_google (file, path, mime_type, dataset_id, size, byte_from, byte_to, first_file)
    service = initialise_api
    filechunk = get_file_from_google(service, file, mime_type, byte_from, byte_to)
    if (!byte_from or byte_from.to_i == 0) 
      write_mode = "wb" 
      if (first_file == "1")
        delete_deposited_files(dataset_id)
      end
    else
      write_mode = "ab"
    end
    write_deposit_chunk(filechunk.string, path, dataset_id, size, write_mode)
  end
def deposit_file_from_google ( file , path , mime_type , dataset_id , size , byte_from , byte_to , first_file ) service = initialise_api filechunk = get_file_from_google ( service , file , mime_type , byte_from , byte_to ) if ( ! byte_from or byte_from . to_i == 0 ) write_mode = "wb" if ( first_file == "1" ) delete_deposited_files ( dataset_id ) end else write_mode = "ab" end write_deposit_chunk ( filechunk . string , path , dataset_id , size , write_mode ) end
given a google file id, a relative path for where it belongs, and a byte range, get the file data from google and write it
given a google file id a relative path for where it belongs and a byte range get the file data from google and write it
# if it's the first portion of the file, write mode should be "write", else "append" # if this is the first file uploaded then delete all existing uploaded files for this dataset before uploading these files
file
<not_specific>
path
<not_specific>
mime_type
<not_specific>
dataset_id
<not_specific>
size
<not_specific>
byte_from
<not_specific>
byte_to
<not_specific>
first_file
<not_specific>