void (String path, LibraryEditor libraryEditor) { File srcRoot = new File(path + "/src/main"); if (srcRoot.exists()) { libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(srcRoot), OrderRootType.SOURCES); } File[] jars; File libDir = new File(path + "/lib"); if (libDir.exists()) { jars = libDir.listFiles(); } else { jars = new File(path + "/embeddable").listFiles(); } if (jars != null) { for (File file : jars) { if (file.getName().endsWith(".jar")) { libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(file), OrderRootType.CLASSES); } } } }