try {
String version = new Manifest(input).getMainAttributes().getValue(Constants.BUNDLE_VERSION);
if (version != null) {
try {
Version v = new Version(version);
return new LibraryVersionProperties(v.getMajor() + "." + v.getMinor() + "." + v.getMicro());
}
catch (IllegalArgumentException ignored) { }
}
}
finally {
input.close();
}
}
catch (IOException ignored) { }
}
}
// unknown version
return new LibraryVersionProperties(null);
}