@Override
public Adapter configureAdapter(SelectorThread st) {
st.setDisplayConfiguration(true);
AtmosphereAdapter adapter = new AtmosphereAdapter();
adapter.addRootFolder(st.getWebAppRootPath());
adapter.setHandleStaticResources(true);
// be sure to convert Windows path
applicationLoc = applicationLoc.replaceAll("\\\\", "/");
String warName = "";
if (applicationLoc.lastIndexOf("/") > -1) {
warName = applicationLoc.substring(applicationLoc.lastIndexOf("/"), applicationLoc.lastIndexOf("."));
} else {
warName = applicationLoc;
}
adapter.setContextPath(warName);
if (!servletPath.startsWith("/")) {
servletPath = "/" + servletPath;
}
adapter.setServletPath(WebAppAdapter.getServletPath(servletPath));
adapter.setResourcePackage(resourcesPackage);
return adapter;
}