Fixes from audit

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2271 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2014-03-18 23:21:12 +00:00
parent e81fb6b5ca
commit 9f28a4a80d
1 changed files with 10 additions and 5 deletions

View File

@ -647,9 +647,9 @@ public abstract class EWSMethod extends PostMethod {
public FileAttachment getAttachmentByName(String attachmentName) {
FileAttachment result = null;
if (attachments != null) {
for (FileAttachment attachment : attachments) {
if (attachmentName.equals(attachment.name)) {
result = attachment;
for (FileAttachment fileAttachment : attachments) {
if (attachmentName.equals(fileAttachment.name)) {
result = fileAttachment;
break;
}
}
@ -712,7 +712,7 @@ public abstract class EWSMethod extends PostMethod {
&& !"ErrorItemNotFound".equals(errorDetail)
) {
try {
throw new EWSException(errorDetail +" "+((errorDescription!=null)?errorDescription:"")+ "\n request: " + new String(generateSoapEnvelope(), "UTF-8"));
throw new EWSException(errorDetail + ' ' +((errorDescription!=null)?errorDescription:"")+ "\n request: " + new String(generateSoapEnvelope(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new EWSException(e.getMessage());
}
@ -905,7 +905,12 @@ public abstract class EWSMethod extends PostMethod {
}
item.addOccurrence(occurrence);
}
/**
* Convert response type to partstat value
* @param responseType response type
* @return partstat value
*/
public static String responseTypeToPartstat(String responseType) {
if ("Accept".equals(responseType) || "Organizer".equals(responseType)) {
return "ACCEPTED";