protected function flushDir($dir)
    {
        if (!file_exists($dir)) {
            echo "HELP cant find ".$dir."\n";
            return;
        }
        $objects = scandir($dir);
        foreach ($objects as $object) {
            try {
                $this->deleteFile($object, $dir);
            } catch (Exception $e) {
                echo "Can't remove Folder/File ".$dir.DIRECTORY_SEPARATOR.$object."<br />\n"
                        . $e->getMessage()."<br />\n";
            }
        }
    }