protected function createNewDirectoryChecker($name, DirectoryResource $resource = null)
    {
        $resource = $resource ?: new DirectoryResource($this->getResource()->getResource().'/'.$name);
        $this->directories[$name] = new NewDirectoryStateChecker($this->getBag(), $resource, $this->getEventsMask());
    }