protected function validateOutput():bool
    {
        $dir = dirname($this->output);

        if (!is_dir($dir) || !is_writable($dir)) {
            throw new DirOutputNotWritableException();
        }

        if (is_file($this->output) && !is_writable($this->output)) {
            throw new FileNotWritableException();
        }
        return true;
    }