public function dir($identifier) {
    if ($identifier === 'root') {
      return $this->getRootDirectory();
    } elseif ($this->directoryLocations->has($identifier)) {
      return $this->directoryLocations->get($identifier);
    } else {
      return $this->package->getDirectory($identifier);
    }
  }