List of usage examples for org.eclipse.jdt.internal.core JavaModelManager addNonChainingJar
public void addNonChainingJar(IPath path)
From source file:com.codenvy.ide.ext.java.server.internal.core.ClasspathEntry.java
License:Open Source License
private static void resolvedChainedLibraries(IPath jarPath, HashSet visited, ArrayList result) { if (visited.contains(jarPath)) return;/*from www . j a v a 2 s . co m*/ visited.add(jarPath); JavaModelManager manager = JavaModelManager.getJavaModelManager(); if (manager.isNonChainingJar(jarPath)) return; List calledFileNames = getCalledFileNames(jarPath); if (calledFileNames == null) { manager.addNonChainingJar(jarPath); } else { Iterator calledFilesIterator = calledFileNames.iterator(); IPath directoryPath = jarPath.removeLastSegments(1); while (calledFilesIterator.hasNext()) { String calledFileName = (String) calledFilesIterator.next(); if (!directoryPath.isValidPath(calledFileName)) { if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) { Util.verbose("Invalid Class-Path entry " + calledFileName + " in manifest of jar file: " //$NON-NLS-1$//$NON-NLS-2$ + jarPath.toOSString()); } } else { IPath calledJar = directoryPath.append(new Path(calledFileName)); // Ignore if segment count is Zero (https://bugs.eclipse.org/bugs/show_bug.cgi?id=308150) if (calledJar.segmentCount() == 0) { if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) { Util.verbose("Invalid Class-Path entry " + calledFileName + " in manifest of jar file: " //$NON-NLS-1$//$NON-NLS-2$ + jarPath.toOSString()); } continue; } resolvedChainedLibraries(calledJar, visited, result); result.add(calledJar); } } } }
From source file:org.eclipse.che.jdt.internal.core.ClasspathEntry.java
License:Open Source License
private static void resolvedChainedLibraries(IPath jarPath, HashSet visited, ArrayList result) { if (visited.contains(jarPath)) return;/*from w w w. java2s .c o m*/ visited.add(jarPath); JavaModelManager manager = JavaModelManager.getJavaModelManager(); if (manager.isNonChainingJar(jarPath)) return; List calledFileNames = getCalledFileNames(jarPath); if (calledFileNames == null) { manager.addNonChainingJar(jarPath); } else { Iterator calledFilesIterator = calledFileNames.iterator(); IPath directoryPath = jarPath.removeLastSegments(1); while (calledFilesIterator.hasNext()) { String calledFileName = (String) calledFilesIterator.next(); if (!directoryPath.isValidPath(calledFileName)) { if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) { Util.verbose("Invalid Class-Path entry " + calledFileName + " in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$ } } else { IPath calledJar = directoryPath.append(new Path(calledFileName)); // Ignore if segment count is Zero (https://bugs.eclipse.org/bugs/show_bug.cgi?id=308150) if (calledJar.segmentCount() == 0) { if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) { Util.verbose("Invalid Class-Path entry " + calledFileName + " in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$ } continue; } resolvedChainedLibraries(calledJar, visited, result); result.add(calledJar); } } } }