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); }
try (IReader reader = index.getNd().acquireReadLock()) { NdResourceFile resourceFile = index.getResourceFile(location.toCharArray()); if (index.isUpToDate(resourceFile)) { char[] manifestContent = resourceFile.getManifestContent().getChars(); if (manifestContent.length == 0) {
try (IReader reader = index.getNd().acquireReadLock()) { NdResourceFile resourceFile = index.getResourceFile(location.toCharArray()); if (index.isUpToDate(resourceFile)) { char[] manifestContent = resourceFile.getManifestContent().getChars(); if (manifestContent.length == 0) {
if (!resourcePath.isEmpty()) { NdResourceFile resourceFile = index.getResourceFile(resourcePath.toString().toCharArray()); if (index.isUpToDate(resourceFile)) { usedIndex = true; long level = resourceFile.getJdkLevel();
if (index.isUpToDate(resourceFile)) { return null; if (index.isUpToDate(resourceFile)) { IndexBinaryType result = new IndexBinaryType(typeRef, descriptor.indexPath);
if (index.isUpToDate(resourceFile)) { return null; if (index.isUpToDate(resourceFile)) { IndexBinaryType result = new IndexBinaryType(typeRef, descriptor.indexPath);
if (!resourcePath.isEmpty()) { NdResourceFile resourceFile = index.getResourceFile(resourcePath.toString().toCharArray()); if (index.isUpToDate(resourceFile)) { usedIndex = true; long level = resourceFile.getJdkLevel();