+
 class FSHelper
 
-  parseWatcherFile = ({ vmName, parentPath, file, user, treeController, osKite })->
   @createFileInstance = (options)->
 
     if typeof options is 'string'


    return instance

    {name, size, mode} = file
    type      = if file.isBroken then 'brokenLink' else \
                if file.isDir then 'folder' else 'file'
    path      = if parentPath is "[#{vmName}]/" then "[#{vmName}]/#{name}" else \
                "#{parentPath}/#{name}"
    group     = user
    createdAt = file.time
    return { size, user, group, createdAt, mode, type, \
             parentPath, path, name, vmName:vmName, treeController, osKite }


  @parseWatcher = ({ vmName, parentPath, files, treeController, osKite })->
    data = []
    return data unless files
    files = [files] unless Array.isArray files

    sortedFiles = partition(files.sort(sortFiles), (file) -> file.isDir)
      .reduce (acc, next) -> acc.concat next

    for file in sortedFiles
      data.push FSHelper.createFileInstance \
        parseWatcherFile { file, machine, parentPath, treeController }

    return data

