use of com.sun.enterprise.util.SystemPropertyConstants.INSTALL_ROOT_PROPERTY in project Payara by payara.
the class CommonClassLoaderServiceImpl method findH2Client.
private List<File> findH2Client() {
final String H2_HOME_PROP = "AS_H2_INSTALL";
StartupContext startupContext = env.getStartupContext();
Properties arguments = null;
if (startupContext != null) {
arguments = startupContext.getArguments();
}
String h2Home = null;
if (arguments != null) {
h2Home = arguments.getProperty(H2_HOME_PROP, System.getProperty(H2_HOME_PROP));
}
File h2Lib = null;
if (h2Home != null) {
h2Lib = new File(h2Home, "bin");
} else if (env.isMicro() && arguments != null) {
h2Home = arguments.getProperty(INSTALL_ROOT_PROPERTY, System.getProperty(INSTALL_ROOT_PROPERTY));
h2Lib = new File(h2Home, "runtime");
}
if (h2Lib == null || !h2Lib.exists()) {
logger.info(KernelLoggerInfo.cantFindH2);
return Collections.EMPTY_LIST;
}
return Arrays.asList(h2Lib.listFiles((dir, name) -> name.startsWith("h2") && name.endsWith(".jar")));
}
Aggregations