Manifest result = null;
final Object[] nonJavaResources = packageFragmentRoot.getNonJavaResources();
for (Object obj : nonJavaResources) {
if (obj instanceof JarEntryDirectory) {
final JarEntryDirectory jarEntryDirectory = (JarEntryDirectory) obj;
final IJarEntryResource[] jarEntryResources = jarEntryDirectory.getChildren();
for (IJarEntryResource jarEntryResource : jarEntryResources) {
if ("MANIFEST.MF".equals(jarEntryResource.getName())) {
try {
final InputStream stream = jarEntryResource.getContents();
result = new Manifest(stream);