while (entries.hasMoreElements()) {
JarEntry entry = entries.nextElement();
String name = entry.getName();
if (name.startsWith("OSGI-INF/metatype/")) {
if (name.endsWith(XML_SUFFIX)) {
MetaDataReader reader = new MetaDataReader();
InputStream in = jarFile.getInputStream(entry);
if (in != null) {
String text = IOHelpers.readFully(in);
MetaData metadata = reader.parse(new ByteArrayInputStream(text.getBytes()));
if (metadata != null) {
String pid = name.substring(0, name.length() - XML_SUFFIX.length());
xmlMap.put(pid, text);
metadataMap.put(pid, metadata);
}