in jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/ExtUtils.java [54:87]
public static JarEntryFile findJarEntryFile(IPackageFragmentRoot packageRoot, String path) throws JavaModelException {
String[] segments = StringUtils.split(path, "/");
String packageName = StringUtils.join(Arrays.asList(segments).subList(0, segments.length - 1), '.');
IPackageFragment packageFragment = packageRoot.getPackageFragment(packageName);
if (packageFragment != null && packageFragment.exists()) {
Object[] objs = packageFragment.getNonJavaResources();
for (Object obj : objs) {
if (obj instanceof IJarEntryResource) {
IJarEntryResource child = (IJarEntryResource) obj;
if (child instanceof JarEntryFile && child.getFullPath().toPortableString().equals(path)) {
return (JarEntryFile) child;
}
}
}
}
Object[] resources = packageRoot.getNonJavaResources();
for (Object resource : resources) {
if (resource instanceof JarEntryFile) {
JarEntryFile file = (JarEntryFile) resource;
if (file.getFullPath().toPortableString().equals(path)) {
return file;
}
}
if (resource instanceof JarEntryDirectory) {
JarEntryDirectory directory = (JarEntryDirectory) resource;
JarEntryFile file = findFileInJar(directory, path);
if (file != null) {
return file;
}
}
}
return null;
}