private static boolean checkCreateSubdirectory(PsiDirectory directory, String part) {
    try {
      directory.checkCreateSubdirectory(part);
    }
    catch (IncorrectOperationException ex) {
      return false;
    }
    // we assume that we will be able create the rest of file tree in a new directory
    return true;
  }
private static boolean checkCreateSubdirectory(PsiDirectory directory, String part)