java: Get manifest file of my war from a webservice request

Viewed 97

I'm working on a webapp which have webservices.

I'm to get build version, specification title etc which are then in the manifest file to respond to the resful service

For a web request I can do below. How can I access the manifest resource from a webservice request

FacesContext.getCurrentInstance().getExternalContext().getResourceAsStream("/META-INF/MANIFEST.MF")

1 Answers

By reading the java doc, it looks like that the package information only exists in the JAR file. which was generated by
jar cfm MyJar.jar Manifest.txt yourPackage/*.class

and the Manifest.txt would be:

Name: java/util/
Specification-Title: Java Utility Classes
Specification-Version: 1.2
Specification-Vendor: Example Tech, Inc.
Implementation-Title: java.util
Implementation-Version: build57
Implementation-Vendor: Example Tech, Inc.

Related