jpower.core.JPower Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JPower Show documentation
Show all versions of JPower Show documentation
Powerful Library for the JVM
package jpower.core;
import jpower.core.utils.IOUtils;
import java.io.IOException;
import java.util.Map;
import java.util.HashMap;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class JPower
{
private static final Release release;
static
{
String rawRelease = IOUtils.getResourceAsString(JPower.class, "release.properties");
Pattern pattern = Pattern.compile("(.*)=(.*)");
Matcher matcher = pattern.matcher(rawRelease);
Map info = new HashMap<>();
while (matcher.find())
{
info.put(matcher.group(1), matcher.group(2));
}
release = new Release(info);
}
public static Release getRelease()
{
return release;
}
public static class Release
{
private final String version;
private final String commit;
public Release(Map info)
{
version = info.get("version");
commit = info.get("commit");
}
public String getVersion()
{
return version;
}
public String getCommit()
{
return commit;
}
}
}