* @param jar the jar file
* @return the found file or <code>null</code> if not found.
* @throws java.io.IOException occurs when the Jar file cannot be read.
*/
private File findMetadata(JarFile jar) throws IOException {
JarEntry je = jar.getJarEntry("metadata.xml");
if (je == null) {
je = jar.getJarEntry("META-INF/metadata.xml");
}
if (je == null) {
logger.log(LOG_DEBUG, "Metadata file not found, use annotations only.");
return null; // Not Found, use annotation only
} else {
logger.log(LOG_DEBUG, format("Metadata file found at %s", je.getName()));
File metadata = File.createTempFile("ipojo-", ".xml", m_temp);
dump(jar.getInputStream(je), metadata);
logger.log(LOG_DEBUG, format("Metadata file saved at %s", metadata));
return metadata;
}