X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/968c535e19e40bee7df8609fd050bc2196ca95e6..1551a5280afc682baf84582c150b3a9a4e47f219:/src/com/owncloud/android/authentication/AccountUtils.java diff --git a/src/com/owncloud/android/authentication/AccountUtils.java b/src/com/owncloud/android/authentication/AccountUtils.java index 1e67aa67..9afa819c 100644 --- a/src/com/owncloud/android/authentication/AccountUtils.java +++ b/src/com/owncloud/android/authentication/AccountUtils.java @@ -250,4 +250,21 @@ public class AccountUtils { } + public static String trimWebdavSuffix(String url) { + while(url.endsWith("/")) { + url = url.substring(0, url.length() - 1); + } + int pos = url.lastIndexOf(WEBDAV_PATH_4_0_AND_LATER); + if (pos >= 0) { + url = url.substring(0, pos); + + } else { + pos = url.lastIndexOf(ODAV_PATH); + if (pos >= 0) { + url = url.substring(0, pos); + } + } + return url; + } + }