private @Nullable @NlsContexts.DetailedDescription String checkForErrors(String inputString) {
    final StringTokenizer tokenizer = new StringTokenizer(inputString, myDelimiters);
    VirtualFile vFile = myDirectory.getVirtualFile();
    boolean firstToken = true;
    while (tokenizer.hasMoreTokens()) {
      final String token = tokenizer.nextToken();
      if (!tokenizer.hasMoreTokens() && (token.equals(".") || token.equals(".."))) {
        return IdeBundle.message("error.invalid.directory.name", token);
      }
      if (vFile != null) {
        if (firstToken && "~".equals(token)) {
          final VirtualFile userHomeDir = VfsUtil.getUserHomeDir();
          if (userHomeDir == null) {
            return IdeBundle.message("error.user.home.directory.not.found");
          }
          vFile = userHomeDir;
        }
        else if ("..".equals(token)) {
          final VirtualFile parent = vFile.getParent();
          if (parent == null) {
            return IdeBundle.message("error.invalid.directory", vFile.getPresentableUrl() + File.separatorChar + "..");
          }
          vFile = parent;
        }
        else if (!".".equals(token)){
          final VirtualFile child = vFile.findChild(token);
          if (child != null) {
            if (!child.isDirectory()) {
              return IdeBundle.message("error.file.with.name.already.exists", token);
            }
            else if (!tokenizer.hasMoreTokens()) {
              return IdeBundle.message("error.directory.with.name.already.exists", token);
            }
          }
          vFile = child;
        }
      }
      firstToken = false;
    }
    return null;
  }
private @Nullable @NlsContexts.DetailedDescription String checkForErrors(String inputString)