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

cfml.parsing.Version Maven / Gradle / Ivy

There is a newer version: 2.11.0
Show newest version
package cfml.parsing;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Version {
	
	public static String getVersion() {
		final InputStream is = Version.class
				.getResourceAsStream("/META-INF/maven/com.github.cfparser/cfml.parsing/pom.properties");
		try {
			final BufferedReader reader = new BufferedReader(new InputStreamReader(is));
			String line = reader.readLine();
			while (line != null && !line.startsWith("version=")) {
				line = reader.readLine();
			}
			if (line != null) {
				return line.replaceAll("version=", "");
			}
		} catch (final Exception e) {
			try {
				if (is != null) {
					is.close();
				}
			} catch (final IOException e1) {
				e1.printStackTrace();
			}
		}
		return "";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy