                 return true
             }
         }
-        // else, return true.
+
         return false
     }
     
     class func directoryExists(#path: String) -> Bool {
         var isDirectory: ObjCBool = ObjCBool(false)
-        NSFileManager.defaultManager().fileExistsAtPath(path, isDirectory: &isDirectory)
-        
+        if path.rangeOfString("/.Trash") == nil || path.isEmpty {
+            NSFileManager.defaultManager().fileExistsAtPath(path, isDirectory: &isDirectory)
+        }
         return isDirectory.boolValue
     }
     

        task.standardOutput = pipe
        task.launch()
        
        var string: String = NSString(data: pipe.fileHandleForReading.readDataToEndOfFile(), encoding:NSUTF8StringEncoding)!
        
        // No directories inside path = no directory which contains a dot = valid = return true


    // The renaming should be done directly from the main bash script (ScriptExecutor)
    class func directoryContainsInvalidCharacters(#path: String, options: AnyObject?) -> Bool {
        NSLog("Checking if directory contains invalid characters")
        
        var task: NSTask = NSTask()
        var pipe = NSPipe()
        
