public function releaseResource(AbstractResourceFile $resource) {
        if (is_null($this->getReleaseDir())) {
            throw new Exception("ERROR: RELEASE DIR IS NULL: " . $resource->getRealPath());
        }
        if (!$this->getReleaseDir()->exists()) {
            $this->getReleaseDir()->mkdirs();
        }
        $release_file = $this->makeReleaseFile($resource);
        $release_dir = $release_file->getAbsoluteFile()->getParentFile();
        if (!$release_dir->exists()) {
            if (!$release_dir->mkdirs()) {
                throw new FileWriteErrorException("The directory '" . $release_dir->getAbsolutePath() . "' create fails.");
            }
        }
        \file_put_contents($release_file->getAbsolutePath(), $resource->getFileContents());
    }