+ updateServerStatusIconAndText(result);\r
+ showServerStatus();\r
+\r
+ /// very special case (TODO: move to a common place for all the remote operations)\r
+ if (result.getCode() == ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED) {\r
+ mLastSslUntrustedServerResult = result;\r
+ showDialog(DIALOG_SSL_VALIDATOR); \r
+ }\r
+\r
+ /// retrieve discovered version and normalize server URL\r
+ mDiscoveredVersion = operation.getDiscoveredVersion();\r
+ mHostBaseUrl = normalizeUrl(mHostUrlInput.getText().toString());\r
+\r
+ /// allow or not the user try to access the server\r
+ mOkButton.setEnabled(mServerIsValid);\r
+\r
+ } // else nothing ; only the last check operation is considered; \r
+ // multiple can be triggered if the user amends a URL before a previous check can be triggered\r
+ }\r
+\r
+\r
+ private String normalizeUrl(String url) {\r
+ if (url != null && url.length() > 0) {\r
+ url = url.trim();\r
+ if (!url.toLowerCase().startsWith("http://") &&\r
+ !url.toLowerCase().startsWith("https://")) {\r
+ if (mIsSslConn) {\r
+ url = "https://" + url;\r
+ } else {\r
+ url = "http://" + url;\r
+ }\r
+ }\r
+\r
+ // OC-208: Add suffix remote.php/webdav to normalize (OC-34) \r
+ url = trimUrlWebdav(url);\r
+\r
+ if (url.endsWith("/")) {\r
+ url = url.substring(0, url.length() - 1);\r
+ }\r
+\r