io.castle.client.model.CastleSdkRef Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of castle-java Show documentation
Show all versions of castle-java Show documentation
Castle adds real-time monitoring of your authentication stack, instantly notifying you and your users
on potential account hijacks.
package io.castle.client.model;
import java.util.Properties;
import io.castle.client.Castle;
import io.castle.client.internal.config.PropertiesReader;
import java.io.InputStream;
/**
* The reference to the current version of the SDK.
*/
public class CastleSdkRef {
private String name = "castle-java";
private String version;
CastleSdkRef() {
this.version = loadSdkVersion().getProperty("sdk.version");
}
public String getName() {
return name;
}
public String getVersion() {
return version;
}
@Override
public String toString() {
return "CastleSdkRef{" +
"name='" + name + '\'' +
", version='" + version + '\'' +
'}';
}
private Properties loadSdkVersion() {
Properties versionProperties = new Properties();
PropertiesReader reader = new PropertiesReader();
InputStream resourceAsStream = Castle.class.getClassLoader().getResourceAsStream("version.properties");
return reader.loadPropertiesFromStream(versionProperties, resourceAsStream);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy