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

org.daisy.dotify.SystemProperties Maven / Gradle / Ivy

There is a newer version: 3.2.5
Show newest version
package org.daisy.dotify;

import org.daisy.dotify.cli.ManifestRetriever;

/**
 * Provides common property values of the system
 * @author Joel Håkansson
 *
 */
public final class SystemProperties {
	private static final ManifestRetriever retriever = new ManifestRetriever(SystemProperties.class);
	/**
	 * Defines the system name
	 */
	public static final String SYSTEM_NAME = getWithDefault(retriever.getManifest().getMainAttributes().getValue("Implementation-Title"), "Dotify");
	/**
	 * Defines the system build
	 */
	public static final String SYSTEM_BUILD = getWithDefault(retriever.getManifest().getMainAttributes().getValue("Repository-Revision"), "N/A");
	/**
	 * Defines the system release
	 */
	public static final String SYSTEM_RELEASE = getWithDefault(retriever.getManifest().getMainAttributes().getValue("Implementation-Version"), "N/A");
	
	private static final String getWithDefault(String val, String def) {
		return (val!=null?val:def);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy