String packageName = DirectoryIndex.getInstance(dir.getProject()).getPackageName(dir.getVirtualFile());
try {
return createClass(className, packageName, dir, templateName).getContainingFile();
}
catch (Exception e) {
throw new IncorrectOperationException(e.getMessage(), e);
}
}