private String getFolderName(String folderUrl) { if (folderUrl == null) { return null; } // Here we extract the folder name starting from the complete url. // folderUrl is in the form http://mail.domain.com/exchange/username/foldername // so we need "foldername" which is the string after the fifth slash int folderSlash = -1; for (int j = 0; j < 5; j++) { folderSlash = folderUrl.indexOf('/', folderSlash + 1); if (folderSlash < 0) { break; } } if (folderSlash > 0) { String fullPathName; // Removes the final slash if present if (folderUrl.charAt(folderUrl.length() - 1) == '/') { fullPathName = folderUrl.substring(folderSlash + 1, folderUrl.length() - 1); } else { fullPathName = folderUrl.substring(folderSlash + 1); } // Decodes the url-encoded folder name (i.e. "My%20folder" => "My Folder" return decodeUtf8(fullPathName); } return null; }
username = decodeUtf8(userInfoParts[1]); } else { authenticationType = AuthType.PLAIN; username = decodeUtf8(userInfoParts[0]); username = decodeUtf8(userInfoParts[0]); password = decodeUtf8(userInfoParts[1]); } else if (userInfoParts.length == 3) { username = decodeUtf8(userInfoParts[1]); clientCertificateAlias = decodeUtf8(userInfoParts[2]); } else { password = decodeUtf8(userInfoParts[2]);
if (userInfo != null) { String[] userInfoParts = userInfo.split(":"); username = decodeUtf8(userInfoParts[0]); String userParts[] = username.split("\\\\", 2); password = decodeUtf8(userInfoParts[1]);
authType = AuthType.valueOf(userInfoParts[0]); username = decodeUtf8(userInfoParts[userIndex]); if (userInfoParts.length > passwordIndex) { if (authType == AuthType.EXTERNAL) { clientCertificateAlias = decodeUtf8(userInfoParts[passwordIndex]); } else { password = decodeUtf8(userInfoParts[passwordIndex]);
end = decodeUtf8(end); end = encodeUtf8(end); end = end.replaceAll("\\+", "%20");
end = decodeUtf8(end); end = encodeUtf8(end); end = end.replaceAll("\\+", "%20");