mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-07 03:38:05 -05:00
More fixes from audit
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1474 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
fe73982491
commit
cabb7b6c1f
@ -45,6 +45,12 @@ public class ICSBufferedWriter {
|
|||||||
writeLine(line, false);
|
writeLine(line, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write line with or without continuation prefix.
|
||||||
|
*
|
||||||
|
* @param line line content
|
||||||
|
* @param prefix continuation flag
|
||||||
|
*/
|
||||||
public void writeLine(String line, boolean prefix) {
|
public void writeLine(String line, boolean prefix) {
|
||||||
int maxLength = 77;
|
int maxLength = 77;
|
||||||
if (prefix) {
|
if (prefix) {
|
||||||
|
@ -252,7 +252,7 @@ public class ExchangePropPatchMethod extends PostMethod {
|
|||||||
|
|
||||||
|
|
||||||
protected void handleProperty(XMLStreamReader reader, MultiStatusResponse multiStatusResponse) throws XMLStreamException {
|
protected void handleProperty(XMLStreamReader reader, MultiStatusResponse multiStatusResponse) throws XMLStreamException {
|
||||||
while (reader.hasNext() && !XMLStreamUtil.isEndTag(reader, "prop")){
|
while (reader.hasNext() && !XMLStreamUtil.isEndTag(reader, "prop")) {
|
||||||
reader.next();
|
reader.next();
|
||||||
if (XMLStreamUtil.isStartTag(reader)) {
|
if (XMLStreamUtil.isStartTag(reader)) {
|
||||||
String tagLocalName = reader.getLocalName();
|
String tagLocalName = reader.getLocalName();
|
||||||
@ -288,6 +288,12 @@ public class ExchangePropPatchMethod extends PostMethod {
|
|||||||
return responses.get(0);
|
return responses.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return method http status code.
|
||||||
|
*
|
||||||
|
* @return http status code
|
||||||
|
* @throws HttpException on error
|
||||||
|
*/
|
||||||
public int getResponseStatusCode() throws HttpException {
|
public int getResponseStatusCode() throws HttpException {
|
||||||
String responseDescription = getResponse().getResponseDescription();
|
String responseDescription = getResponse().getResponseDescription();
|
||||||
if ("HTTP/1.1 201 Created".equals(responseDescription)) {
|
if ("HTTP/1.1 201 Created".equals(responseDescription)) {
|
||||||
|
@ -27,6 +27,7 @@ public class DeleteItemMethod extends EWSMethod {
|
|||||||
*
|
*
|
||||||
* @param itemId item id
|
* @param itemId item id
|
||||||
* @param deleteType delete mode
|
* @param deleteType delete mode
|
||||||
|
* @param sendMeetingCancellations send meeting cancellation notifications
|
||||||
*/
|
*/
|
||||||
public DeleteItemMethod(ItemId itemId, DeleteType deleteType, SendMeetingCancellations sendMeetingCancellations) {
|
public DeleteItemMethod(ItemId itemId, DeleteType deleteType, SendMeetingCancellations sendMeetingCancellations) {
|
||||||
super("Item", "DeleteItem");
|
super("Item", "DeleteItem");
|
||||||
|
@ -412,10 +412,25 @@ public abstract class EWSMethod extends PostMethod {
|
|||||||
this.serverVersion = serverVersion;
|
this.serverVersion = serverVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Meeting attendee object
|
||||||
|
*/
|
||||||
public static class Attendee {
|
public static class Attendee {
|
||||||
|
/**
|
||||||
|
* attendee role
|
||||||
|
*/
|
||||||
public String role;
|
public String role;
|
||||||
|
/**
|
||||||
|
* attendee email address
|
||||||
|
*/
|
||||||
public String email;
|
public String email;
|
||||||
|
/**
|
||||||
|
* attendee participation status
|
||||||
|
*/
|
||||||
public String partstat;
|
public String partstat;
|
||||||
|
/**
|
||||||
|
* attendee fullname
|
||||||
|
*/
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -565,10 +580,18 @@ public abstract class EWSMethod extends PostMethod {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all attendees.
|
||||||
|
* @return all attendees
|
||||||
|
*/
|
||||||
public List<Attendee> getAttendees() {
|
public List<Attendee> getAttendees() {
|
||||||
return attendees;
|
return attendees;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add attendee.
|
||||||
|
* @param attendee attendee object
|
||||||
|
*/
|
||||||
public void addAttendee(Attendee attendee) {
|
public void addAttendee(Attendee attendee) {
|
||||||
if (attendees == null) {
|
if (attendees == null) {
|
||||||
attendees = new ArrayList<Attendee>();
|
attendees = new ArrayList<Attendee>();
|
||||||
|
@ -31,10 +31,20 @@ public class FileAttachment {
|
|||||||
protected String attachmentId;
|
protected String attachmentId;
|
||||||
protected boolean isContactPhoto;
|
protected boolean isContactPhoto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default constructor
|
||||||
|
*/
|
||||||
public FileAttachment() {
|
public FileAttachment() {
|
||||||
// empty constructor
|
// empty constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build file attachment.
|
||||||
|
*
|
||||||
|
* @param name attachment name
|
||||||
|
* @param contentType content type
|
||||||
|
* @param content body as string
|
||||||
|
*/
|
||||||
public FileAttachment(String name, String contentType, String content) {
|
public FileAttachment(String name, String contentType, String content) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.contentType = contentType;
|
this.contentType = contentType;
|
||||||
@ -70,6 +80,11 @@ public class FileAttachment {
|
|||||||
writer.write("</t:FileAttachment>");
|
writer.write("</t:FileAttachment>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exchange 2010 only: set contact photo flag on attachment.
|
||||||
|
*
|
||||||
|
* @param isContactPhoto contact photo flag
|
||||||
|
*/
|
||||||
public void setIsContactPhoto(boolean isContactPhoto) {
|
public void setIsContactPhoto(boolean isContactPhoto) {
|
||||||
this.isContactPhoto = isContactPhoto;
|
this.isContactPhoto = isContactPhoto;
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ public class FindItemMethod extends EWSMethod {
|
|||||||
* @param traversal folder traversal mode
|
* @param traversal folder traversal mode
|
||||||
* @param baseShape base item shape
|
* @param baseShape base item shape
|
||||||
* @param parentFolderId parent folder id
|
* @param parentFolderId parent folder id
|
||||||
|
* @param maxCount maximum result count
|
||||||
*/
|
*/
|
||||||
public FindItemMethod(FolderQueryTraversal traversal, BaseShape baseShape, FolderId parentFolderId, int maxCount) {
|
public FindItemMethod(FolderQueryTraversal traversal, BaseShape baseShape, FolderId parentFolderId, int maxCount) {
|
||||||
super("Item", "FindItem");
|
super("Item", "FindItem");
|
||||||
|
@ -25,6 +25,8 @@ public class GetAttachmentMethod extends EWSMethod {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Attachment Method.
|
* Get Attachment Method.
|
||||||
|
*
|
||||||
|
* @param attachmentId attachment id
|
||||||
*/
|
*/
|
||||||
public GetAttachmentMethod(String attachmentId) {
|
public GetAttachmentMethod(String attachmentId) {
|
||||||
super("Attachment", "GetAttachment");
|
super("Attachment", "GetAttachment");
|
||||||
|
@ -92,7 +92,7 @@ public class GetUserAvailabilityMethod extends EWSMethod {
|
|||||||
writer.write(end);
|
writer.write(end);
|
||||||
writer.write("</t:EndTime>" +
|
writer.write("</t:EndTime>" +
|
||||||
"</t:TimeWindow>" +
|
"</t:TimeWindow>" +
|
||||||
"<t:MergedFreeBusyIntervalInMinutes>"+interval+"</t:MergedFreeBusyIntervalInMinutes>" +
|
"<t:MergedFreeBusyIntervalInMinutes>" + interval + "</t:MergedFreeBusyIntervalInMinutes>" +
|
||||||
"<t:RequestedView>MergedOnly</t:RequestedView>" +
|
"<t:RequestedView>MergedOnly</t:RequestedView>" +
|
||||||
"</t:FreeBusyViewOptions>");
|
"</t:FreeBusyViewOptions>");
|
||||||
}
|
}
|
||||||
@ -104,6 +104,11 @@ public class GetUserAvailabilityMethod extends EWSMethod {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get merged freebusy string.
|
||||||
|
*
|
||||||
|
* @return freebusy string
|
||||||
|
*/
|
||||||
public String getMergedFreeBusy() {
|
public String getMergedFreeBusy() {
|
||||||
return mergedFreeBusy;
|
return mergedFreeBusy;
|
||||||
}
|
}
|
||||||
|
@ -30,10 +30,20 @@ public class IndexedFieldUpdate extends FieldUpdate {
|
|||||||
final Set<FieldUpdate> updates = new HashSet<FieldUpdate>();
|
final Set<FieldUpdate> updates = new HashSet<FieldUpdate>();
|
||||||
protected final String collectionName;
|
protected final String collectionName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create indexed field update object.
|
||||||
|
*
|
||||||
|
* @param collectionName values collection name e.g. EmailAddresses
|
||||||
|
*/
|
||||||
public IndexedFieldUpdate(String collectionName) {
|
public IndexedFieldUpdate(String collectionName) {
|
||||||
this.collectionName = collectionName;
|
this.collectionName = collectionName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add indexed field value.
|
||||||
|
*
|
||||||
|
* @param fieldUpdate field update object
|
||||||
|
*/
|
||||||
public void addFieldValue(FieldUpdate fieldUpdate) {
|
public void addFieldValue(FieldUpdate fieldUpdate) {
|
||||||
updates.add(fieldUpdate);
|
updates.add(fieldUpdate);
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,11 @@ public class ItemId {
|
|||||||
this.changeKey = item.get("ChangeKey");
|
this.changeKey = item.get("ChangeKey");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build Item id object from item id.
|
||||||
|
*
|
||||||
|
* @param itemId item id
|
||||||
|
*/
|
||||||
public ItemId(String itemId) {
|
public ItemId(String itemId) {
|
||||||
this.id = itemId;
|
this.id = itemId;
|
||||||
this.changeKey = null;
|
this.changeKey = null;
|
||||||
|
@ -293,7 +293,7 @@ public final class StringUtil {
|
|||||||
|
|
||||||
public static String base64ToUrl(String value) {
|
public static String base64ToUrl(String value) {
|
||||||
String result = value;
|
String result = value;
|
||||||
if (value != null) {
|
if (result != null) {
|
||||||
if (result.indexOf('+') >= 0) {
|
if (result.indexOf('+') >= 0) {
|
||||||
result = PLUS_PATTERN.matcher(result).replaceAll("-");
|
result = PLUS_PATTERN.matcher(result).replaceAll("-");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user