All Downloads are FREE. Search and download functionalities are using the official Maven repository.

no.sb1.troxy.util.VersionUtil Maven / Gradle / Ivy

package no.sb1.troxy.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class VersionUtil {

    private static final Logger log = LoggerFactory.getLogger(VersionUtil.class);


    public static String getRelease() {
        return getInternal().getProperty("release", "");
    }

    public static String getVersion() {
        return  getInternal().getProperty("version", "");
    }

    private static Properties getInternal() {

        Properties p = new Properties();
        try (InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("troxy_version.properties")) {
            p.load(inputStream);
        } catch (IOException e) {
            log.info("Unable to read file with Troxy version and release", e);
        }
        return p;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy