private function write()
    {
        if (!$this->file->canWrite()) {
            throw new BuildException(
                "Can't write data store to '" .
                $this->file->getPath() . "'"
            );
        } else {
            $serializedData = serialize($this->data);

            $writer = new FileWriter($this->file);
            $writer->write($serializedData);
            $writer->close();
        }
    }