Skip to content

Instantly share code, notes, and snippets.

@TheBigAleski
Last active March 21, 2018 13:54
Show Gist options
  • Save TheBigAleski/a442e27a9ee1b241d3c38c517a49677c to your computer and use it in GitHub Desktop.
Save TheBigAleski/a442e27a9ee1b241d3c38c517a49677c to your computer and use it in GitHub Desktop.
Manifest to JSONObject
JSONObject json = new JSONObject();
Manifest mf = new Manifest();
mf.read(Thread.currentThread().getContextClassLoader().getResourceAsStream("META-INF/MANIFEST.MF"));
for (Map.Entry<Object, Object> entry:mf.getMainAttributes().entrySet()) {
json.put(entry.getKey().toString(), entry.getValue());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment