    * @example
    *
    *   files = [
-   *     { name: "myapp.ipa",   md5: "54e05c292ef585094a12b20818b3f952" },
-   *     { name: "myapp.plist", md5: "ab1e5d1ed4be9d7cb8376cbf12f85ca8" }
+   *     { location: "/tmp/54e05c292ef585094a12b20818b3f952", name: "myapp.ipa" },
+   *     { location: "/tmp/ab1e5d1ed4be9d7cb8376cbf12f85ca8", name: "myapp.plist" }
    *   ]
    *
   ###

async = require 'async'
path = require 'path'
mv = require 'mv'

RedisObject = require './redis_object'

          @logger.error "Error setting up files for `#{target_loc}`."
        fn(err, { name: file.name, md5: data })

  ###*
   * Deletes the files for the current leaf.
   * @param {Function} (fn) The callback function
  ###
  delete_files: (fn) =>
    dirloc = [@user, @application, @dtype, @current].join('/')
    target_dir = [@config.get('repository'), dirloc].join('/')
    fs.readdir target_dir, (err, reply) =>
      async.parallel reply, fs.unlink, (err) =>
        if err
          @logger.error "Error removing directories for `#{dirloc}`."
        fn(null, true)

module.exports = Files
