private void updateResourceMappings(Map<IPath, List<IJavaElement>> pathsToUpdate, IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, pathsToUpdate.keySet().size()); JavaIndex index = JavaIndex.getIndex(this.nd); for (Entry<IPath, List<IJavaElement>> entry : pathsToUpdate.entrySet()) { SubMonitor iterationMonitor = subMonitor.split(1).setWorkRemaining(10); this.nd.acquireWriteLock(iterationMonitor.split(1)); try { NdResourceFile resourceFile = index.getResourceFile(entry.getKey().toString().toCharArray()); if (resourceFile == null) { continue; } attachWorkspaceFilesToResource(entry.getValue(), resourceFile); } finally { this.nd.releaseWriteLock(); } } }
private void updateResourceMappings(Map<IPath, List<IJavaElement>> pathsToUpdate, IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, pathsToUpdate.keySet().size()); JavaIndex index = JavaIndex.getIndex(this.nd); for (Entry<IPath, List<IJavaElement>> entry : pathsToUpdate.entrySet()) { SubMonitor iterationMonitor = subMonitor.split(1).setWorkRemaining(10); this.nd.acquireWriteLock(iterationMonitor.split(1)); try { NdResourceFile resourceFile = index.getResourceFile(entry.getKey().toString().toCharArray()); if (resourceFile == null) { continue; } attachWorkspaceFilesToResource(entry.getValue(), resourceFile); } finally { this.nd.releaseWriteLock(); } } }
public void verifyArchiveContent(IPath path) throws CoreException { // TODO: we haven't finalized what path the JRT is represented by. Don't attempt to validate it. if (isJrt(path)) { return; } throwExceptionIfArchiveInvalid(path); // Check if we can determine the archive's validity by examining the index if (JavaIndex.isEnabled()) { JavaIndex index = JavaIndex.getIndex(); String location = JavaModelManager.getLocalFile(path).getAbsolutePath(); try (IReader reader = index.getNd().acquireReadLock()) { NdResourceFile resourceFile = index.getResourceFile(location.toCharArray()); if (index.isUpToDate(resourceFile)) { // We have this file in the index and the index is up-to-date, so we can determine the file's // validity without touching the filesystem. if (resourceFile.isCorruptedZipFile()) { throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.status_IOException, new ZipException())); } return; } } } ZipFile file = getZipFile(path); closeZipFile(file); }
public void verifyArchiveContent(IPath path) throws CoreException { // TODO: we haven't finalized what path the JRT is represented by. Don't attempt to validate it. if (isJrt(path)) { return; } throwExceptionIfArchiveInvalid(path); // Check if we can determine the archive's validity by examining the index if (JavaIndex.isEnabled()) { JavaIndex index = JavaIndex.getIndex(); String location = JavaModelManager.getLocalFile(path).getAbsolutePath(); try (IReader reader = index.getNd().acquireReadLock()) { NdResourceFile resourceFile = index.getResourceFile(location.toCharArray()); if (index.isUpToDate(resourceFile)) { // We have this file in the index and the index is up-to-date, so we can determine the file's // validity without touching the filesystem. if (resourceFile.isCorruptedZipFile()) { throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.status_IOException, new ZipException())); } return; } } } ZipFile file = getZipFile(path); closeZipFile(file); }
String location = JavaModelManager.getLocalFile(jarPath).getAbsolutePath(); try (IReader reader = index.getNd().acquireReadLock()) { NdResourceFile resourceFile = index.getResourceFile(location.toCharArray()); if (index.isUpToDate(resourceFile)) { char[] manifestContent = resourceFile.getManifestContent().getChars();
String location = JavaModelManager.getLocalFile(jarPath).getAbsolutePath(); try (IReader reader = index.getNd().acquireReadLock()) { NdResourceFile resourceFile = index.getResourceFile(location.toCharArray()); if (index.isUpToDate(resourceFile)) { char[] manifestContent = resourceFile.getManifestContent().getChars();
IPath resourcePath = JavaIndex.getLocationForElement(this); if (!resourcePath.isEmpty()) { NdResourceFile resourceFile = index.getResourceFile(resourcePath.toString().toCharArray()); if (index.isUpToDate(resourceFile)) { usedIndex = true;
IPath resourcePath = JavaIndex.getLocationForElement(this); if (!resourcePath.isEmpty()) { NdResourceFile resourceFile = index.getResourceFile(resourcePath.toString().toCharArray()); if (index.isUpToDate(resourceFile)) { usedIndex = true;
this.nd.acquireReadLock(); try { resourceFile = javaIndex.getResourceFile(pathString.toCharArray());
this.nd.acquireReadLock(); try { resourceFile = javaIndex.getResourceFile(pathString.toCharArray());
NdResourceFile resourceFile = index.getResourceFile(descriptor.location); if (index.isUpToDate(resourceFile)) { return null;
NdResourceFile resourceFile = index.getResourceFile(descriptor.location); if (index.isUpToDate(resourceFile)) { return null;