class LocalResourceId implements ResourceId {

  @Override
  public LocalResourceId getCurrentDirectory() {
    if (isDirectory()) {
      return this;
    } else {
      Path path = getPath();
      Path parent = path.getParent();
      if (parent == null && path.getNameCount() == 1) {
        parent = Paths.get(".");
      }
      checkState(parent != null, "Failed to get the current directory for path: [%s].", pathString);
      return fromPath(parent, true /* isDirectory */);
    }
  }

  private  LocalResourceId(Path path, boolean isDirectory);

}