mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 17:31:52 -05:00
EWS: return 403 forbidden on ErrorAccessDenied
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1251 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
dfd3473a4c
commit
bc4e2fd539
@ -22,6 +22,7 @@ import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.httpclient.Header;
|
||||
import org.apache.commons.httpclient.HttpConnection;
|
||||
import org.apache.commons.httpclient.HttpState;
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.commons.httpclient.methods.RequestEntity;
|
||||
import org.apache.log4j.Logger;
|
||||
@ -486,6 +487,7 @@ public abstract class EWSMethod extends PostMethod {
|
||||
|
||||
/**
|
||||
* Get file attachment by file name
|
||||
*
|
||||
* @param attachmentName attachment name
|
||||
* @return attachment
|
||||
*/
|
||||
@ -510,14 +512,24 @@ public abstract class EWSMethod extends PostMethod {
|
||||
*/
|
||||
public void checkSuccess() throws EWSException {
|
||||
if (errorDetail != null) {
|
||||
try {
|
||||
throw new EWSException(errorDetail + "\n request: " + new String(generateSoapEnvelope(), "UTF-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new EWSException(e.getMessage());
|
||||
if (!"ErrorAccessDenied".equals(errorDetail)) {
|
||||
try {
|
||||
throw new EWSException(errorDetail + "\n request: " + new String(generateSoapEnvelope(), "UTF-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new EWSException(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getStatusCode() {
|
||||
if ("ErrorAccessDenied".equals(errorDetail)) {
|
||||
return HttpStatus.SC_FORBIDDEN;
|
||||
} else {
|
||||
return super.getStatusCode();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get response items.
|
||||
*
|
||||
|
@ -760,6 +760,8 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||
} else {
|
||||
LOGGER.debug("Updated contact " + getHref());
|
||||
}
|
||||
} else {
|
||||
return itemResult;
|
||||
}
|
||||
|
||||
ItemId newItemId = new ItemId(createOrUpdateItemMethod.getResponseItem());
|
||||
|
Loading…
x
Reference in New Issue
Block a user