private bool IsDavExEnabled()
{
string davExUrl = instance.UrlWithContextPath + "/crx/server/crx.default/jcr:root/.1.json";
Stopwatch responseTimeStopwatch = new Stopwatch();
try {
mLog.Debug("Get bundle list from URL: " + davExUrl);
HttpWebRequest request = instance.WebRequestCreate(davExUrl);
request.Method = "GET";
responseTimeStopwatch.Start();
using (WebResponse response = request.GetResponse()) {
responseTimeStopwatch.Stop();
return(true);
}
}
catch (WebException ex) {
if (ex.Status == WebExceptionStatus.Timeout)
{
mLog.Debug("Unable to connect to " + davExUrl + " due to timeout. "
+ "Configured timeout: " + AEMManager.Properties.Settings.Default.BundleListTimeout + "ms, "
+ "measured response time: " + responseTimeStopwatch.ElapsedMilliseconds + "ms");
}
else
{
mLog.Debug("Unable to connect to " + davExUrl + ": " + ex.Message);
}
}
catch (Exception ex) {
mLog.Error("Error getting DavEx status from URL: " + davExUrl, ex);
}
return(false);
}