diff options
Diffstat (limited to 'src/com')
3 files changed, 15 insertions, 11 deletions
diff --git a/src/com/isode/stroke/elements/JingleFileTransferFileInfo.java b/src/com/isode/stroke/elements/JingleFileTransferFileInfo.java index 100afd9..fc4675e 100644 --- a/src/com/isode/stroke/elements/JingleFileTransferFileInfo.java +++ b/src/com/isode/stroke/elements/JingleFileTransferFileInfo.java @@ -39,7 +39,7 @@ public class JingleFileTransferFileInfo extends Payload { * Default Constructor. */ public JingleFileTransferFileInfo() { - this("", "", 0, new Date(0L)); + this("", "", 0, null); } /** @@ -47,7 +47,7 @@ public class JingleFileTransferFileInfo extends Payload { * @param name, NotNull. */ public JingleFileTransferFileInfo(String name) { - this(name, "", 0, new Date(0L)); + this(name, "", 0, null); } /** @@ -56,7 +56,7 @@ public class JingleFileTransferFileInfo extends Payload { * @param description, NotNull. */ public JingleFileTransferFileInfo(String name, String description) { - this(name, description, 0, new Date(0L)); + this(name, description, 0, null); } /** @@ -66,7 +66,7 @@ public class JingleFileTransferFileInfo extends Payload { * @param size. */ public JingleFileTransferFileInfo(String name, String description, long size) { - this(name, description, size, new Date(0L)); + this(name, description, size, null); } /** @@ -74,19 +74,18 @@ public class JingleFileTransferFileInfo extends Payload { * @param name, NotNull. * @param description, NotNull. * @param size. - * @param date, NotNull. + * @param date. Null means invalid date. */ public JingleFileTransferFileInfo(String name, String description, long size, Date date) { NotNull.exceptIfNull(name, "name"); NotNull.exceptIfNull(description, "description"); - NotNull.exceptIfNull(date, "date"); + TimeZone.setDefault(TimeZone.getTimeZone("UTC")); this.name_ = name; this.description_ = description; this.size_ = size; this.date_ = date; this.supportsRangeRequests_ = false; this.rangeOffset_ = 0; - TimeZone.setDefault(TimeZone.getTimeZone("UTC")); } /** @@ -149,15 +148,14 @@ public class JingleFileTransferFileInfo extends Payload { } /** - * @param date, NotNull. + * @param date. Null means invalid date. */ public void setDate(Date date) { - NotNull.exceptIfNull(date, "date"); date_ = date; } /** - * @return date, NotNull. + * @return date, which may be null for an invalid date. */ public Date getDate() { return date_; diff --git a/src/com/isode/stroke/elements/VCard.java b/src/com/isode/stroke/elements/VCard.java index 2eb26d0..3bd4db2 100644 --- a/src/com/isode/stroke/elements/VCard.java +++ b/src/com/isode/stroke/elements/VCard.java @@ -162,10 +162,16 @@ public class VCard extends Payload implements Serializable { if (emailAddresses_ != null) emailAddresses_.clear(); } + /** + * @param date, null indicates invalid date. + */ public void setBirthday(final Date birthday) { birthday_ = birthday; } + /** + * @return date, may be null which indicates invalid date. + */ public final Date getBirthday() { return birthday_; } diff --git a/src/com/isode/stroke/serializer/payloadserializers/JingleFileTransferFileInfoSerializer.java b/src/com/isode/stroke/serializer/payloadserializers/JingleFileTransferFileInfoSerializer.java index a9ae722..2efea78 100644 --- a/src/com/isode/stroke/serializer/payloadserializers/JingleFileTransferFileInfoSerializer.java +++ b/src/com/isode/stroke/serializer/payloadserializers/JingleFileTransferFileInfoSerializer.java @@ -32,7 +32,7 @@ public class JingleFileTransferFileInfoSerializer extends GenericPayloadSerializ public String serializePayload(JingleFileTransferFileInfo fileInfo) { XMLElement fileElement = new XMLElement("file", ""); - if (fileInfo.getDate().getTime() != 0L) { + if (fileInfo.getDate() != null) { fileElement.addNode(new XMLElement("date", "", DateTime.dateToString(fileInfo.getDate()))); } |