mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-05 18:58:02 -05:00
Apply new base64 methods to CaldavConnection
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2245 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
cf10953212
commit
1f11758bb2
@ -28,6 +28,7 @@ import davmail.exchange.ExchangeSessionFactory;
|
||||
import davmail.exchange.ICSBufferedReader;
|
||||
import davmail.exchange.XMLStreamUtil;
|
||||
import davmail.ui.tray.DavGatewayTray;
|
||||
import davmail.util.IOUtil;
|
||||
import davmail.util.StringUtil;
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
@ -471,7 +472,7 @@ public class CaldavConnection extends AbstractConnection {
|
||||
}
|
||||
if (request.hasProperty("getctag")) {
|
||||
response.appendProperty("CS:getctag", "CS=\"http://calendarserver.org/ns/\"",
|
||||
base64Encode(folder.ctag));
|
||||
IOUtil.encodeBase64(folder.ctag));
|
||||
}
|
||||
if (request.hasProperty("displayname")) {
|
||||
if (subFolder == null || subFolder.length() == 0) {
|
||||
@ -520,8 +521,8 @@ public class CaldavConnection extends AbstractConnection {
|
||||
if (!session.isSharedFolder(folderPath)) {
|
||||
try {
|
||||
ExchangeSession.Folder folder = session.getFolder(folderPath);
|
||||
ctag = base64Encode(folder.ctag);
|
||||
etag = base64Encode(folder.etag);
|
||||
ctag = IOUtil.encodeBase64(folder.ctag);
|
||||
etag = IOUtil.encodeBase64(folder.etag);
|
||||
} catch (HttpException e) {
|
||||
// unauthorized access, probably an inbox on shared calendar
|
||||
DavGatewayTray.debug(new BundleMessage("LOG_ACCESS_FORBIDDEN", folderPath, e.getMessage()));
|
||||
@ -833,7 +834,7 @@ public class CaldavConnection extends AbstractConnection {
|
||||
if (request.hasProperty("getctag")) {
|
||||
ExchangeSession.Folder rootFolder = session.getFolder("");
|
||||
response.appendProperty("CS:getctag", "CS=\"http://calendarserver.org/ns/\"",
|
||||
base64Encode(rootFolder.ctag));
|
||||
IOUtil.encodeBase64(rootFolder.ctag));
|
||||
}
|
||||
response.endPropStatOK();
|
||||
if (request.getDepth() == 1) {
|
||||
@ -1285,7 +1286,7 @@ public class CaldavConnection extends AbstractConnection {
|
||||
throw new DavMailException("EXCEPTION_UNSUPPORTED_AUTHORIZATION_MODE", mode);
|
||||
}
|
||||
String encodedCredentials = authorization.substring(index + 1);
|
||||
String decodedCredentials = base64Decode(encodedCredentials);
|
||||
String decodedCredentials = IOUtil.decodeBase64AsString(encodedCredentials);
|
||||
index = decodedCredentials.indexOf(':');
|
||||
if (index > 0) {
|
||||
userName = decodedCredentials.substring(0, index);
|
||||
|
Loading…
Reference in New Issue
Block a user