List Library of project programmatically

"ortega" <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <[email protected]>
Hello, after manny hours snd searchs i make a kind of solution:

import org.netbeans.api.project.Project;

Project[] openProject

for (Project project : openProject) {
    FileObject projectDir = project.getProjectDirectory();
    String projectLocation = projectDir.getPath();
    //
    ArrayList<String> jarPathList = new ArrayList<>();
    projectLocation += File.separator + "nbproject" + File.separator + "project.properties";
    if (new File(projectLocation).exists()) {
       FileInputStream fstream = new FileInputStream(projectLocation);
       try (BufferedReader br = new BufferedReader(new InputStreamReader(fstream))) {
                        String strLine;
                        while ((strLine = br.readLine()) != null) {
                            if (strLine.contains("file.reference.") && !strLine.contains("$")) {
                                if (!jarPathList.contains(strLine.substring(strLine.indexOf("=") + 1))) {
                                    jarPathList.add(strLine.substring(strLine.indexOf("=") + 1));
                                }
                            }
                        }
                    }
    }
    //
    for (String jarPath : jarPathList) {
        JarFile jarFile = new JarFile(jarPath);
        Enumeration allEntries = jarFile.entries();
        while (allEntries.hasMoreElements()) {
            JarEntry entry = (JarEntry) allEntries.nextElement();
            String name = entry.getName();  
            if (!entry.isDirectory() && name.endsWith(".class") && !name.contains("$")) {
                System.out.println(name);
            } 
        }
    }
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.