         ).then (keys) =>
           if not angular.isArray(keys)
             keys = [keys]
-          console.log "keys", keys
+          $log.log "keys", keys
           dataKey = keys[0]
           if keys.length > 1
             subfolderKey = keys[1]

              doc.subfolderKey = subfolderKey
              new @(doc)
          catch
            console.error "decrypt error"


    @getMetadata: (id, parentKey) ->
      @get(id, parentKey)

    generateReadCrypTreeKeys: (parentKey) ->

    generateWriteCrypTreeKeys: (parentKey) ->

    @_getDataKeyLinkKey: (doc, parentFolder) ->
      @_getParent(doc, parentFolder)
      .then (parentFolder) =>
        $log.log "parentFolder", parentFolder
        @_getParentKey(doc, parentFolder)
      .catch () =>
        throw "Impossible to open this file/folder"

    @_getKeys: (doc, parentFolder) ->
      @_getDataKeyLinkKey(doc, parentFolder).then (key) =>
        $log.log "parentKey", key
        CrypTree.resolveSymLink(doc.dataKeyLink, key).then (dataKey) =>
          return [dataKey, key]

