Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -39,11 +40,11 @@
@RestController
public class VersionController {

private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());
private static final Logger logger = LoggerFactory.getLogger(VersionController.class);

@CrossOrigin()
@Operation(summary = "Get version information")
@GetMapping(value = "/version",consumes = "application/json", produces = "application/json")
@GetMapping(value = "/version", produces = "application/json")
public String versionInformation() {
OutputResponse output = new OutputResponse();
try {
Expand All @@ -59,7 +60,10 @@ public String versionInformation() {
private String readGitProperties() throws Exception {
ClassLoader classLoader = getClass().getClassLoader();
InputStream inputStream = classLoader.getResourceAsStream("git.properties");

if (inputStream == null) {
throw new FileNotFoundException("git.properties file not found in classpath");
}

return readFromInputStream(inputStream);
}
private String readFromInputStream(InputStream inputStream)
Expand Down