protected function ensureDirExists($path)
    {
        $f = new PhingFile($this->getOutputDirectory(), $path);
        if (!$f->exists()) {
            if (!$f->mkdirs()) {
                throw new BuildException("Error creating directories: " . $f->getPath());
            }
        }
    }