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

com.afrigis.services.util.Version Maven / Gradle / Ivy

There is a newer version: 3.0.2
Show newest version
package com.afrigis.services.util;

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

import org.apache.commons.io.IOUtils;

/**
 * 

* Carefully and safely extracts the library version if available. *

* * @author hendrikc * */ public final class Version { private Version() { } /** *

* Extracts and returns the semantic version of this lib. *

* * @return the version of this library */ public static String getVersion() { final String path = "/version.prop"; InputStream stream = null; final Properties props = new Properties(); try { stream = Version.class.getResourceAsStream(path); props.load(stream); return (String) props.get("version"); } catch (IOException e) { return "UNKNOWN"; } finally { IOUtils.closeQuietly(stream); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy