*/
private boolean ignoreVersioned;
private String getThemeDescriptor(File jarFile) throws MojoExecutionException {
ZipFile zip = null;
try {
zip = new ZipFile(jarFile);
Enumeration files = zip.getEntries();
while (files.hasMoreElements()) {
ZipEntry nextEntry = (ZipEntry) files.nextElement();
if (nextEntry == null || nextEntry.isDirectory()) {
continue;
}
String name = nextEntry.getName();
if (name.equals("META-INF/tobago-theme.xml") || name.equals("META-INF/tobago-config.xml")) {
XmlStreamReader xsr = null;
try {
StringWriter stringWriter = new StringWriter();
xsr = ReaderFactory.newXmlReader(zip.getInputStream(nextEntry));
IOUtil.copy(xsr, stringWriter);
return stringWriter.toString();
} finally {
IOUtil.close(xsr);
}
}
}
} catch (IOException e) {
throw new MojoExecutionException("Error find ThemeDescriptor in " + jarFile, e);
} finally {
if (zip != null) {
try {
zip.close();
} catch (IOException e) {
// ignore
}
}
}