 
     return multipartRequestBody
 
+  # metadataのget
   get: (fileId, callback) ->
-    request = gapi.client.drive.files.get({
-      'fileId' : fileId
+    gapi.client.load('drive', 'v2', ->
+      request = gapi.client.drive.files.get({
+        'fileId' : fileId
+      })
+      if (!callback)
+        callback = (file) ->
+          console.log(file)
+      request.execute(callback)
+    )
+
+  # fileの中身のget
+  getFileResource: (downloadUrl, accessToken, callback) ->
+    $.ajax({
+      method: 'GET'
+      url: downloadUrl
+      headers: {
+        'Authorization': 'Bearer ' + accessToken
+      }
     })
-    if (!callback)
-      callback = (file) ->
-        console.log(file)
-    request.execute(callback)
+    .always((data) ->
+      callback(data)
+    )
 
   insert: (title, content, callback) ->
     multipartRequestBody = this.requestBody(title, content)

    else
      caller.alertView.show("warning", "Fail GoogleDrive authorization")

  uploadAlert: (file, methodName, caller)->
    if !file.error
      caller.alertView.show("info", "Success " + methodName + "!")
    else
      caller.alertView.show("danger", "Fail " + methodName + "!")

  createPicker: ()->
    console.log("picker create")
    this.showPicker(this)

  showPicker: (that)->
    client_id = that.model.get('client_id')
    access_token = that.model.get("access_token")
    if access_token

    this.model.authorize(this.authorizeAlert, this)

  upload: ()->
    title = this.model_handler.getEditorTitle()
    content = this.model_handler.getEditorContent()
    this.model.upload(title, content, this.uploadFileAlert, this)

  updateDocumentLink: ()->
    console.log("update_document_link")
