private static String explodedEntryIfZip(SpringYarnAppmasterLaunchContextProperties syalcp) {
return StringUtils.endsWithIgnoreCase(syalcp.getArchiveFile(), ".zip") ? "./" + syalcp.getArchiveFile() : null;
}
private static String[] createContainerCommands(SpringYarnAppmasterLaunchContextProperties syalcp) throws Exception {
LaunchCommandsFactoryBean factory = new LaunchCommandsFactoryBean();
String containerJar = syalcp.getArchiveFile();
if (StringUtils.hasText(containerJar) && containerJar.endsWith("jar")) {
factory.setJarFile(containerJar);
} else if (StringUtils.hasText(syalcp.getRunnerClass())) {
factory.setRunnerClass(syalcp.getRunnerClass());
} else if (StringUtils.hasText(containerJar) && containerJar.endsWith("zip")) {
factory.setRunnerClass("org.springframework.boot.loader.PropertiesLauncher");
}
factory.setArgumentsList(syalcp.getArgumentsList());
if (syalcp.getArguments() != null) {
Properties arguments = new Properties();
arguments.putAll(syalcp.getArguments());
factory.setArguments(arguments);
}
factory.setOptions(syalcp.getOptions());
factory.setStdout("<LOG_DIR>/Container.stdout");
factory.setStderr("<LOG_DIR>/Container.stderr");
factory.afterPropertiesSet();
return factory.getObject();
}