private function setDirectory($directory) {
        if (is_string($directory) === false) {
            throw new \InvalidArgumentException('Directory must be a string');
        }

        if (is_dir($directory) === false || is_writable($directory) === false) {
            throw new Exception\File($directory . ' doesn\'t exist or isn\'t writable');
        }

        $this->directory = $directory . (substr($directory, -1) !== DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : '');

        return $this;
    }