1
0
mirror of https://github.com/moparisthebest/davmail synced 2025-01-05 18:58:02 -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:
mguessan 2010-09-24 08:44:13 +00:00
parent fe73982491
commit cabb7b6c1f
11 changed files with 83 additions and 9 deletions

View File

@ -45,6 +45,12 @@ public class ICSBufferedWriter {
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) {
int maxLength = 77;
if (prefix) {

View File

@ -288,6 +288,12 @@ public class ExchangePropPatchMethod extends PostMethod {
return responses.get(0);
}
/**
* Return method http status code.
*
* @return http status code
* @throws HttpException on error
*/
public int getResponseStatusCode() throws HttpException {
String responseDescription = getResponse().getResponseDescription();
if ("HTTP/1.1 201 Created".equals(responseDescription)) {

View File

@ -27,6 +27,7 @@ public class DeleteItemMethod extends EWSMethod {
*
* @param itemId item id
* @param deleteType delete mode
* @param sendMeetingCancellations send meeting cancellation notifications
*/
public DeleteItemMethod(ItemId itemId, DeleteType deleteType, SendMeetingCancellations sendMeetingCancellations) {
super("Item", "DeleteItem");

View File

@ -412,10 +412,25 @@ public abstract class EWSMethod extends PostMethod {
this.serverVersion = serverVersion;
}
/**
* Meeting attendee object
*/
public static class Attendee {
/**
* attendee role
*/
public String role;
/**
* attendee email address
*/
public String email;
/**
* attendee participation status
*/
public String partstat;
/**
* attendee fullname
*/
public String name;
}
@ -565,10 +580,18 @@ public abstract class EWSMethod extends PostMethod {
return result;
}
/**
* Get all attendees.
* @return all attendees
*/
public List<Attendee> getAttendees() {
return attendees;
}
/**
* Add attendee.
* @param attendee attendee object
*/
public void addAttendee(Attendee attendee) {
if (attendees == null) {
attendees = new ArrayList<Attendee>();

View File

@ -31,10 +31,20 @@ public class FileAttachment {
protected String attachmentId;
protected boolean isContactPhoto;
/**
* Default constructor
*/
public FileAttachment() {
// 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) {
this.name = name;
this.contentType = contentType;
@ -70,6 +80,11 @@ public class FileAttachment {
writer.write("</t:FileAttachment>");
}
/**
* Exchange 2010 only: set contact photo flag on attachment.
*
* @param isContactPhoto contact photo flag
*/
public void setIsContactPhoto(boolean isContactPhoto) {
this.isContactPhoto = isContactPhoto;
}

View File

@ -28,6 +28,7 @@ public class FindItemMethod extends EWSMethod {
* @param traversal folder traversal mode
* @param baseShape base item shape
* @param parentFolderId parent folder id
* @param maxCount maximum result count
*/
public FindItemMethod(FolderQueryTraversal traversal, BaseShape baseShape, FolderId parentFolderId, int maxCount) {
super("Item", "FindItem");

View File

@ -25,6 +25,8 @@ public class GetAttachmentMethod extends EWSMethod {
/**
* Get Attachment Method.
*
* @param attachmentId attachment id
*/
public GetAttachmentMethod(String attachmentId) {
super("Attachment", "GetAttachment");

View File

@ -104,6 +104,11 @@ public class GetUserAvailabilityMethod extends EWSMethod {
}
}
/**
* Get merged freebusy string.
*
* @return freebusy string
*/
public String getMergedFreeBusy() {
return mergedFreeBusy;
}

View File

@ -30,10 +30,20 @@ public class IndexedFieldUpdate extends FieldUpdate {
final Set<FieldUpdate> updates = new HashSet<FieldUpdate>();
protected final String collectionName;
/**
* Create indexed field update object.
*
* @param collectionName values collection name e.g. EmailAddresses
*/
public IndexedFieldUpdate(String collectionName) {
this.collectionName = collectionName;
}
/**
* Add indexed field value.
*
* @param fieldUpdate field update object
*/
public void addFieldValue(FieldUpdate fieldUpdate) {
updates.add(fieldUpdate);
}

View File

@ -38,6 +38,11 @@ public class ItemId {
this.changeKey = item.get("ChangeKey");
}
/**
* Build Item id object from item id.
*
* @param itemId item id
*/
public ItemId(String itemId) {
this.id = itemId;
this.changeKey = null;

View File

@ -293,7 +293,7 @@ public final class StringUtil {
public static String base64ToUrl(String value) {
String result = value;
if (value != null) {
if (result != null) {
if (result.indexOf('+') >= 0) {
result = PLUS_PATTERN.matcher(result).replaceAll("-");
}