public static VirtualFile createDir(Project project, final VirtualFile parent, final String name) {
    final Ref<VirtualFile> result = new Ref<VirtualFile>();
    new WriteCommandAction.Simple(project) {
      @Override
      protected void run() throws Throwable {
        try {
          VirtualFile dir = parent.findChild(name);
          if (dir == null) {
            dir = parent.createChildDirectory(this, name);
          }
          result.set(dir);
        }
        catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
    }.execute();
    return result.get();
  }
public static VirtualFile createDir(Project project, final VirtualFile parent, final String name) {
    final Ref<VirtualFile> result = new Ref<VirtualFile>();
    new WriteCommandAction.Simple(project) {
      @Override
      protected void run() throws Throwable {
        try {
          VirtualFile dir = parent.findChild(name);
          if (dir == null) {
            dir = parent.createChildDirectory(this, name);
          }
          result.set(dir);
        }
        catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
    }.execute();
    return result.get();
  }
public static virtualfile createdir(project project, final virtualfile parent, final string name) { final ref<virtualfile> result = new ref<virtualfile>(); new writecommandaction.simple(project) { @override protected void run() throws throwable { try { virtualfile dir = parent.findchild(name); if (dir == null) { dir = parent.createchilddirectory(this, name); } result.set(dir); } catch (ioexception e) { throw new runtimeexception(e); } } }.execute(); return result.get(); }