ValidationResult (@NotNull String baseDirPath) { List<RootDescription> descriptions = myModuleDescriptions.getValue(); if (descriptions != null && !descriptions.isEmpty()) { File baseDirFile = new File(baseDirPath); for (RootDescription description : descriptions) { File rootFile = new File(baseDirFile + "/" + description.myRelativePath); try { rootFile = rootFile.getCanonicalFile(); if (rootFile.exists()) { String[] list = rootFile.list(); if (list == null) { return new ValidationResult( LangBundle.message("dialog.message.already.exists.so.project.root.can.t.be.created.html", rootFile.getAbsolutePath())); } if (list.length > 0) { return new ValidationResult( LangBundle.message("dialog.message.directory.already.exists.and.is.not.empty", rootFile.getAbsolutePath())); } } } catch (IOException e) { throw new RuntimeException(e); } } } return null; }