\r
public static final byte ACTION_CREATE = 0;\r
public static final byte ACTION_UPDATE_TOKEN = 1;\r
-\r
-\r
+ \r
private String mHostBaseUrl;\r
private OwnCloudVersion mDiscoveredVersion;\r
\r
\r
\r
private void checkOcServer() {\r
- String uri = mHostUrlInput.getText().toString().trim();\r
+ String uri = trimUrlWebdav(mHostUrlInput.getText().toString().trim());\r
mServerIsValid = false;\r
mServerIsChecked = false;\r
mOkButton.setEnabled(false);\r
} else {\r
url = "http://" + url;\r
}\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
}\r
+ Log_OC.d(TAG, "URL Normalize " + url);\r
return (url != null ? url : "");\r
}\r
\r
+\r
+ private String trimUrlWebdav(String url){ \r
+ if(url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_4_0)){\r
+ url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_4_0.length()); \r
+ } else if(url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_2_0)){\r
+ url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_2_0.length()); \r
+ } else if (url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_1_2)){\r
+ url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_1_2.length()); \r
+ } \r
+ return (url != null ? url : "");\r
+ }\r
+ \r
+ \r
/**\r
* Chooses the right icon and text to show to the user for the received operation result.\r
* \r