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

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

Go to download

Troxy is a proxy intended for simulating a remote service without actually connecting to the server. Incoming requests are matched using regular expressions and responses are created from a recorded response from the remote service and optionally modified by inserting values caught from the regular expression used to match the request.

There is a newer version: 3.2.49
Show newest version
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