gnu.io.rfc2217.Version Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nrjavaserial Show documentation
Show all versions of nrjavaserial Show documentation
A fork of the RXTX library with a focus on ease of use and embeddability in other libraries.
/*
* Copyright (C) 2010 Archie L. Cobbs. All rights reserved.
*
* $Id$
*/
package gnu.io.rfc2217;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
* Contains library version information.
*/
public final class Version {
/**
* The version of this library.
*/
public static final String JVSER_VERSION;
private static final String PROPERTIES_RESOURCE = "/jvser.properties";
private static final String VERSION_PROPERTY_NAME = "jvser.version";
static {
Properties properties = new Properties();
InputStream input = Version.class.getResourceAsStream(PROPERTIES_RESOURCE);
if (input == null)
throw new RuntimeException("can't find resource " + PROPERTIES_RESOURCE);
try {
properties.load(input);
} catch (IOException e) {
throw new RuntimeException("unexpected exception", e);
} finally {
try {
input.close();
} catch (IOException e) {
// ignore
}
}
JVSER_VERSION = properties.getProperty(VERSION_PROPERTY_NAME, "?");
}
private Version() {
}
}