public function setReleasesDirectory($releasesDirectory)
    {
        if (preg_match('/(^|\/)\.\.(\/|$)/', $releasesDirectory)) {
            throw new InvalidConfigurationException(
                sprintf('"../" is not allowed in the releases directory "%s"', $releasesDirectory),
                1380870750
            );
        }
        $this->releasesDirectory = trim($releasesDirectory, '/');
        return $this;
    }