public function build()
    {
        $files = $this->filesystem->listFiles($this->directory, $this->recursive);

        $this->cache->clear();

        foreach ($files as $file) {
            $entity = $this->parseFile($file);
            if ($entity != null) $this->cache->put($entity->getIdentifier(), $entity);
        }
        
        $this->cache->persist();
    }