Import newModule into EmptyProject Problem

Hello,

i'm trying to write a plugin that import all Modules of a special folder into an empty project. But if i use the method newModule(String path, String moduleTypeID), i get an Error.
First of all, the path is where the empty project is located.
Which moduleTypeID i have to write?
And why i get an Error like "Extension is missing for storage file"?

thanks for help

[   8417]  ERROR - com.intellij.ide.IdeEventQueue - Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(577,99),absolute(583,99),button=1,modifiers=Button1,clickCount=1] on frame0
java.lang.IllegalArgumentException: Extension is missing for storage file: D:/Users/Test/
    at com.intellij.openapi.components.impl.stores.StateStorageManagerImpl.createFileStateStorage(StateStorageManagerImpl.java:231)
    at com.intellij.openapi.components.impl.stores.StateStorageManagerImpl.getFileStateStorage(StateStorageManagerImpl.java:125)
    at com.intellij.openapi.components.impl.stores.ModuleStoreImpl.getMainStorage(ModuleStoreImpl.java:60)
    at com.intellij.openapi.components.impl.stores.BaseFileConfigurableStoreImpl.getMainStorageData(BaseFileConfigurableStoreImpl.java:119)
    at com.intellij.openapi.components.impl.stores.ModuleStoreImpl.getMainStorageData(ModuleStoreImpl.java:98)
    at com.intellij.openapi.components.impl.stores.ModuleStoreImpl.setOption(ModuleStoreImpl.java:222)
    at com.intellij.openapi.module.impl.ModuleImpl.setOption(ModuleImpl.java:245)
    at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.newModule(ModuleManagerImpl.java:656)
    at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.newModule(ModuleManagerImpl.java:642)
    at com.intellij.openapi.module.impl.ModuleManagerImpl.newModule(ModuleManagerImpl.java:419)
    at ModuleCreation$1.run(ModuleCreation.java:57)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1013)
    at ModuleCreation.actionPerformed(ModuleCreation.java:41)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:162)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:259)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:892)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:114)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:230)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:104)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:512)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:44)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:532)
    at java.awt.Component.processMouseEvent(Component.java:6505)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
    at java.awt.Component.processEvent(Component.java:6270)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4861)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:708)
    at java.awt.EventQueue$4.run(EventQueue.java:706)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:700)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:521)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:348)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
[   8423]  ERROR - com.intellij.ide.IdeEventQueue - IntelliJ IDEA 12.1.6  Build #IC-129.1359
[   8423]  ERROR - com.intellij.ide.IdeEventQueue - JDK: 1.7.0_40
[   8423]  ERROR - com.intellij.ide.IdeEventQueue - VM: Java HotSpot(TM) 64-Bit Server VM
[   8423]  ERROR - com.intellij.ide.IdeEventQueue - Vendor: Oracle Corporation
[   8423]  ERROR - com.intellij.ide.IdeEventQueue - OS: Windows 7
[   8423]  ERROR - com.intellij.ide.IdeEventQueue - Last Action: Test3

Please sign in to leave a comment.