mirror of
https://github.com/RatzzFatzz/MKVAudioSubtitleChanger.git
synced 2026-02-11 02:05:56 +01:00
28 lines
870 B
Java
28 lines
870 B
Java
package at.pcgamingfreaks.mkvaudiosubtitlechanger.util;
|
|
|
|
import picocli.CommandLine;
|
|
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.util.Properties;
|
|
|
|
public class ProjectUtil implements CommandLine.IVersionProvider {
|
|
private static final Properties PROJECT_PROPERTIES = new Properties();
|
|
|
|
static {
|
|
try (InputStream propertiesStream = ProjectUtil.class.getClassLoader().getResourceAsStream("project.properties")) {
|
|
PROJECT_PROPERTIES.load(propertiesStream);
|
|
} catch (IOException e) {
|
|
throw new RuntimeException(e.getMessage());
|
|
}
|
|
}
|
|
|
|
public String[] getVersion() {
|
|
return new String[] {getProjectName() + " " + PROJECT_PROPERTIES.getProperty("version")};
|
|
}
|
|
|
|
public static String getProjectName() {
|
|
return PROJECT_PROPERTIES.getProperty("project_name");
|
|
}
|
|
}
|