Skip to content

Commit

Permalink
Endpoint /versions improved
Browse files Browse the repository at this point in the history
  • Loading branch information
z-sztrom committed Nov 15, 2024
1 parent 9c2a9c7 commit 2f9d740
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.1.15
- Endpoint /versions made more robust.

## 2.1.14
- Made changes to /generate end-point to improve efficiency how result of event generation is handled

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<properties>
<eiffel-remrem-generate.version>2.1.14</eiffel-remrem-generate.version>
<eiffel-remrem-generate.version>2.1.15</eiffel-remrem-generate.version>
<eiffel-remrem-semantics.version>2.2.7</eiffel-remrem-semantics.version>
</properties>
<artifactId>eiffel-remrem-generate</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,17 @@ public Map<String, Map<String, String>> getMessagingVersions() {
*/
public Map<String, String> getServiceVersion() {
String resourcesPath = this.getClass().getClassLoader().getResource("").getPath();
String manifestPath = resourcesPath.substring(0, resourcesPath.lastIndexOf(WEB_INF)).concat(META_INF_MANIFEST_MF);
int indexWebInf = resourcesPath.lastIndexOf(WEB_INF);
if (indexWebInf == -1) {
// "WEB-INF" was not found in the path, strange...
log.error("Cannot find '" + WEB_INF + "' in the path '" + resourcesPath +
"'. Not loaded from a WAR file?");
serviceVersion.put(VERSION, "\"ERROR: " + META_INF_MANIFEST_MF +
" not found; was the service run from a WAR file?\"");
return serviceVersion;
}

String manifestPath = resourcesPath.substring(0, indexWebInf).concat(META_INF_MANIFEST_MF);
try {
Manifest manifest = new Manifest(new FileInputStream(manifestPath));
Attributes mainAttribs = manifest.getMainAttributes();
Expand Down

0 comments on commit 2f9d740

Please sign in to comment.