-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathJavaApiVersionInfo.java
More file actions
39 lines (31 loc) · 1.19 KB
/
JavaApiVersionInfo.java
File metadata and controls
39 lines (31 loc) · 1.19 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
package org.utplsql.api;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
/** This class is getting updated automatically by the build process.
* Please do not update its constants manually cause they will be overwritten.
*
* @author pesse
*/
public class JavaApiVersionInfo {
private JavaApiVersionInfo() { }
private static final String MAVEN_PROJECT_NAME = "utPLSQL-java-api";
private static String MAVEN_PROJECT_VERSION = "unknown";
static {
try {
MAVEN_PROJECT_VERSION = Files.readAllLines(
Paths.get(JavaApiVersionInfo.class.getClassLoader().getResource("utplsql-api.version").toURI())
, Charset.defaultCharset())
.get(0);
}
catch ( IOException | URISyntaxException e ) {
System.out.println("WARNING: Could not get Version information!");
}
}
public static String getVersion() { return MAVEN_PROJECT_VERSION; }
public static String getInfo() { return MAVEN_PROJECT_NAME + " " + getVersion(); }
}