Package com.aoindustries.version
Class PropertiesVersions
- java.lang.Object
-
- com.aoindustries.version.PropertiesVersions
-
public class PropertiesVersions extends Object
Loads version numbers from a properties file. The properties file should have a three-component value for each product, along with a single build.number property for the last component of the version number.- Author:
- AO Industries, Inc.
-
-
Constructor Summary
Constructors Constructor Description PropertiesVersions(InputStream in)Loads properties from the provided inputstream.PropertiesVersions(Class<?> clazz, String resource)Loads properties from the classpath.PropertiesVersions(Properties properties)Uses the provided properties directly, no defensive copy is made.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBuild()Gets the build number that is applied to all products.VersiongetVersion(String product)Gets the version number for the provided product.
-
-
-
Constructor Detail
-
PropertiesVersions
public PropertiesVersions(Class<?> clazz, String resource) throws IOException
Loads properties from the classpath.- Throws:
IOException
-
PropertiesVersions
public PropertiesVersions(InputStream in) throws IOException
Loads properties from the provided inputstream.- Throws:
IOException
-
PropertiesVersions
public PropertiesVersions(Properties properties)
Uses the provided properties directly, no defensive copy is made.
-
-
Method Detail
-
getVersion
public Version getVersion(String product) throws IllegalArgumentException
Gets the version number for the provided product.- Throws:
IllegalArgumentException
-
getBuild
public int getBuild() throws IllegalArgumentExceptionGets the build number that is applied to all products.- Throws:
IllegalArgumentException
-
-