boolean (String inputString) { final StringTokenizer tokenizer = new StringTokenizer(inputString, "\\/"); VirtualFile vFile = getDirectory().getVirtualFile(); boolean firstToken = true; while (tokenizer.hasMoreTokens()) { final String token = tokenizer.nextToken(); if ((token.equals(".") || token.equals("..")) && !tokenizer.hasMoreTokens()) { myErrorText = IdeBundle.message("error.invalid.file.name", token); return false; } if (vFile != null) { if (firstToken && "~".equals(token)) { final VirtualFile userHomeDir = VfsUtil.getUserHomeDir(); if (userHomeDir == null) { myErrorText = IdeBundle.message("error.user.home.directory.not.found"); return false; } vFile = userHomeDir; } else if ("..".equals(token)) { final VirtualFile parent = vFile.getParent(); if (parent == null) { myErrorText = IdeBundle.message("error.invalid.directory", vFile.getPresentableUrl() + File.separatorChar + ".."); return false; } vFile = parent; } else if (!".".equals(token)) { final VirtualFile child = vFile.findChild(token); if (child != null) { if (!child.isDirectory()) { myErrorText = IdeBundle.message("error.file.with.name.already.exists", token); return false; } else if (!tokenizer.hasMoreTokens()) { myErrorText = IdeBundle.message("error.directory.with.name.already.exists", token); return false; } } vFile = child; } } if (FileTypeManager.getInstance().isFileIgnored(getFileName(token))) { myErrorText = IdeBundle.message("warning.create.directory.with.ignored.name", token); return true; } firstToken = false; } myErrorText = null; return true; }