# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: C:\Users\vbk\nbhg\main # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java --- glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java Base (BASE) +++ glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java Locally Modified (Based On LOCAL) @@ -58,6 +58,7 @@ import org.netbeans.spi.server.ServerInstanceImplementation; import org.netbeans.spi.server.ServerInstanceProvider; import org.openide.WizardDescriptor.InstantiatingIterator; +import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; import org.openide.util.Lookup; @@ -259,8 +260,8 @@ * @param escape pass true if backslashes in jar names should be escaped * @return the complete list of jars that match the selection criteria */ - public static List filterByManifest(List jarList, File parent, int depth, boolean escape) { - if(parent.exists()) { + public static List filterByManifest(List jarList, FileObject parent, int depth, boolean escape) { + if(null != parent) { int parentLength = parent.getPath().length(); /* modules/web/jsf-impl.jar was not seen (or added with wrong relative name). * need to calculate size relative to the modules/ dir and not the subdirs @@ -269,20 +270,21 @@ * with this test, we now also return "web/jsf-impl.jar" which is correct */ if (depth==1){ - parentLength = parent.getParentFile().getPath().length(); + parentLength = parent.getParent().getPath().length(); } - for(File candidate: parent.listFiles()) { - if(candidate.isDirectory()) { + + for(FileObject candidate: parent.getChildren()) { + if(candidate.isFolder()) { if(depth < 1) { filterByManifest(jarList, candidate, depth+1, escape); } continue; - } else if(!candidate.getName().endsWith(".jar")) { + } else if(!candidate.getNameExt().endsWith(".jar")) { continue; } JarFile jarFile = null; try { - jarFile = new JarFile(candidate, false); + jarFile = new JarFile(FileUtil.toFile(candidate), false); Manifest manifest = jarFile.getManifest(); if(manifest != null) { Attributes attrs = manifest.getMainAttributes(); @@ -290,7 +292,7 @@ String bundleName = attrs.getValue("Bundle-SymbolicName"); //String bundleName = attrs.getValue("Extension-Name"); if(bundleName != null && bundleName.contains("javax")) { - String val = candidate.getPath().substring(parentLength+1); + String val = candidate.getPath().substring(parentLength); if(escape) { val = val.replace("\\", "\\\\"); } @@ -300,23 +302,20 @@ } } catch (IOException ex) { Logger.getLogger(ServerUtilities.class.getName()).log(Level.INFO, - candidate.getAbsolutePath(), ex); + candidate.getPath(), ex); } finally { if (null != jarFile) { try { jarFile.close(); } catch (IOException ex) { Logger.getLogger(ServerUtilities.class.getName()).log(Level.INFO, - candidate.getAbsolutePath(), ex); + candidate.getPath(), ex); } jarFile = null; } } } - } else { - Logger.getLogger(ServerUtilities.class.getName()).log(Level.FINER, - parent.getAbsolutePath() + " does not exist"); } return jarList; } Index: glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/ide/Hk2PluginProperties.java --- glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/ide/Hk2PluginProperties.java Base (BASE) +++ glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/ide/Hk2PluginProperties.java Locally Modified (Based On LOCAL) @@ -64,6 +64,7 @@ import org.netbeans.modules.glassfish.spi.GlassfishModule; import org.netbeans.modules.glassfish.spi.ServerUtilities; import org.openide.ErrorManager; +import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; import org.openide.modules.InstalledFileLocator; @@ -190,7 +191,9 @@ // Prelude doesn't have the javax.javaee jar, since it is not a // complete Java EE 5 implementation. File modulesDir = new File(serverDir.getAbsolutePath() + File.separatorChar + ServerUtilities.GFV3_MODULES_DIR_NAME); - jars = ServerUtilities.filterByManifest(jars, modulesDir, 0, true); \ No newline at end of file + FileObject mDFO = FileUtil.toFileObject(FileUtil.normalizeFile(modulesDir)); + if (null != mDFO) + jars = ServerUtilities.filterByManifest(jars, mDFO, 0, true); \ No newline at end of file } // add webservices.jar if exists