refresh( false );
}
}
public List<ProjectNodeKey> libraries () {
VisibilityQuery q = VisibilityQuery.getDefault();
List<ProjectNodeKey> keys = new ArrayList<>();
Map<String, List<FileObject>> otherLibs = findOtherModules( project.getProjectDirectory() );
FileObject libFolder = project.getProjectDirectory().getFileObject( NodeJSProjectFactory.NODE_MODULES_FOLDER );
if (libFolder != null) {
Set<ProjectNodeKey> libFolders = new HashSet<>();
Set<FileObject> childFolders = new LinkedHashSet<>();
for (FileObject lib : libFolder.getChildren()) {
File f = FileUtil.toFile( lib );
try {
f = f.getCanonicalFile();
lib = FileUtil.toFileObject( FileUtil.normalizeFile( f ) );
} catch ( IOException ex ) {
Logger.getLogger( LibrariesChildFactory.class.getName() ).log( Level.FINER,
"No canonical file for " + lib.getPath(), ex ); //NOI18N
}
childFolders.add( lib );
}
for (FileObject lib : childFolders) {
boolean visible = q.isVisible( lib );
if ((visible) && (!NodeJSProjectFactory.NODE_MODULES_FOLDER.equals( lib.getName() ))
&& (!"nbproject".equals( lib.getName() )) && (lib.isFolder())) { //NOI18N
if (otherLibs.containsKey( lib.getName() )) {
otherLibs.remove( lib.getName() );
}