tech.ydb.core.utils.Version Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ydb-sdk-core Show documentation
Show all versions of ydb-sdk-core Show documentation
Core module of Java SDK for YDB
package tech.ydb.core.utils;
import java.io.InputStream;
import java.util.Optional;
import java.util.Properties;
public class Version {
public static final String UNKNOWN_VERSION = "unknown-version";
private Version() {
//
}
public static Optional getVersion() {
try {
Properties prop = new Properties();
InputStream in = Version.class.getResourceAsStream("/ydb_sdk_version.properties");
prop.load(in);
return Optional.ofNullable(prop.getProperty("version"));
} catch (Exception ex) {
return Optional.empty();
}
}
}