Skip to content

Commit

Permalink
Merge pull request #11 from pagopa/stub-info
Browse files Browse the repository at this point in the history
stub info
  • Loading branch information
pasqualespica authored Sep 15, 2023
2 parents f86e942 + 6f4ed98 commit c304c5b
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/main/java/it/gov/pagopa/receipt/pdf/generator/Info.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,18 @@ public HttpResponseMessage run (
public synchronized AppInfo getInfo() {
String version = null;
String name = null;
try (InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("application.properties")) {
Properties properties = new Properties();
if (inputStream != null) {
properties.load(inputStream);
version = properties.getProperty("version", null);
name = properties.getProperty("name", null);
}
} catch (Exception e) {
logger.error("Impossible to retrieve information from pom.properties file.", e);
}
return AppInfo.builder().version(version).environment("azure-fn").name(name).build();
// try (InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("application.properties")) {
// Properties properties = new Properties();
// if (inputStream != null) {
// properties.load(inputStream);
// version = properties.getProperty("version", null);
// name = properties.getProperty("name", null);
// }
// } catch (Exception e) {
// logger.error("Impossible to retrieve information from pom.properties file.", e);
// }
// return AppInfo.builder().version(version).environment("azure-fn").name(name).build();
return AppInfo.builder().version("fake").environment("fake").name("name").build();

}
}

0 comments on commit c304c5b

Please sign in to comment.