 
     delete: ->
       _funcName = 'delete'
-      console.log _funcName
+      $log.log _funcName
       if @metadata.contentId?
         DbDoc.delete {_id: @metadata.contentId}, @dataKey
-      DbDoc.delete {_id: @_id}, @dataKey+      DbDoc.delete {_id: @_id}, @dataKey

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

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


          content._id = @_id
        if @_rev
          content._rev = @_rev
      $log.debug "saveContent", content, @dataKey
      DbDoc.encryptAndSave(content, @dataKey)

    save: () ->
      _funcName = "save"
      $log.log _funcName
      if @content?
        @saveContent().then (contentResult) =>
          unless @metadata?
