forked from Unidata/netcdf-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildInfo.java
More file actions
42 lines (32 loc) · 1.08 KB
/
Copy pathBuildInfo.java
File metadata and controls
42 lines (32 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* Copyright (c) 2025 University Corporation for Atmospheric Research/Unidata
* See LICENSE for license information.
*/
package ucar.nc2.ui;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class BuildInfo {
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(BuildInfo.class);
private final String version, timestamp;
BuildInfo(String version, String timestamp) {
this.version = version;
this.timestamp = timestamp;
}
public String getVersion() {
return version;
}
public String getTimestamp() {
return timestamp;
}
static BuildInfo getToolsUIBuildInfo() {
Properties buildProps = new Properties();
try (InputStream stream = ToolsUI.class.getClassLoader().getResourceAsStream("toolsui.properties")) {
buildProps.load(stream);
} catch (IOException e) {
log.error("Error reading build properties");
}
return new BuildInfo(buildProps.getProperty("toolsui.version", "Unknown"),
buildProps.getProperty("toolsui.buildTimestamp", "Unknown"));
}
}