end = decodeUtf8(end); end = encodeUtf8(end); end = end.replaceAll("\\+", "%20"); } catch (IllegalArgumentException iae) {
private void buildFolderUrl() { String encodedName; String[] urlParts = this.mName.split("/"); String url = ""; for (int i = 0, count = urlParts.length; i < count; i++) { if (i != 0) { url = url + "/" + encodeUtf8(urlParts[i]); } else { url = encodeUtf8(urlParts[i]); } } encodedName = url; encodedName = encodedName.replaceAll("\\+", "%20"); this.mFolderUrl = store.getUrl(); if (!store.getUrl().endsWith("/")) { this.mFolderUrl += "/"; } this.mFolderUrl += encodedName; }
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; }
String userEnc = encodeUtf8(server.username); String passwordEnc = (server.password != null) ? encodeUtf8(server.password) : ""; String clientCertificateAliasEnc = (server.clientCertificateAlias != null) ? encodeUtf8(server.clientCertificateAlias) : "";
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]);
end = decodeUtf8(end); end = encodeUtf8(end); end = end.replaceAll("\\+", "%20");
String userEnc = encodeUtf8(server.username); String passwordEnc = (server.password != null) ? encodeUtf8(server.password) : "";
if (userInfo != null) { String[] userInfoParts = userInfo.split(":"); username = decodeUtf8(userInfoParts[0]); String userParts[] = username.split("\\\\", 2); password = decodeUtf8(userInfoParts[1]);
String userEnc = encodeUtf8(server.username); String passwordEnc = (server.password != null) ? encodeUtf8(server.password) : ""; String clientCertificateAliasEnc = (server.clientCertificateAlias != null) ? encodeUtf8(server.clientCertificateAlias) : "";
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]);
messageURL += "/"; messageURL += encodeUtf8(message.getUid() + ":" + System.currentTimeMillis() + ".eml");