boolean (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; }