private static boolean checkCreateFile(PsiDirectory directory, String newFileName) {
    try {
      directory.checkCreateFile(newFileName);
    }
    catch (IncorrectOperationException ex) {
      return false;
    }
    return true;
  }
private static boolean checkCreateFile(PsiDirectory directory, String newFileName)