summaryrefslogtreecommitdiff
path: root/src/org/noreply/fancydress/directory/ServerDescriptor.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/noreply/fancydress/directory/ServerDescriptor.java')
-rw-r--r--src/org/noreply/fancydress/directory/ServerDescriptor.java59
1 files changed, 48 insertions, 11 deletions
diff --git a/src/org/noreply/fancydress/directory/ServerDescriptor.java b/src/org/noreply/fancydress/directory/ServerDescriptor.java
index 2f076f6..020d31b 100644
--- a/src/org/noreply/fancydress/directory/ServerDescriptor.java
+++ b/src/org/noreply/fancydress/directory/ServerDescriptor.java
@@ -45,11 +45,11 @@ public class ServerDescriptor {
private Boolean secureConfiguration;
private String whyInsecure;
- private IncomingMMTPSection IncomingMMTPSection;
- private Object OutgoingMMTPSection;
- private DeliveryMBOXSection DeliveryMBOXSection;
- private DeliverySMTPSection DeliverySMTPSection;
- private Object DeliveryFragmentedSection;
+ private IncomingMMTPSection incomingMMTPSection;
+ private Object outgoingMMTPSection;
+ private DeliveryMBOXSection deliveryMBOXSection;
+ private DeliverySMTPSection deliverySMTPSection;
+ private Object deliveryFragmentedSection;
/**
@@ -79,17 +79,17 @@ public class ServerDescriptor {
DirectorySection section;
section = m.getSection("Incoming/MMTP");
try {
- IncomingMMTPSection = section == null ? null : new IncomingMMTPSection(section);
+ incomingMMTPSection = section == null ? null : new IncomingMMTPSection(section);
} catch (Mix3BadServerFormatException e) { System.err.println(e); };
section = m.getSection("Delivery/MBOX");
try {
- DeliveryMBOXSection = section == null ? null : new DeliveryMBOXSection(section);
+ deliveryMBOXSection = section == null ? null : new DeliveryMBOXSection(section);
} catch (Mix3BadServerFormatException e) { System.err.println(e); };
section = m.getSection("Delivery/SMTP");
try {
- DeliverySMTPSection = section == null ? null : new DeliverySMTPSection(section);
+ deliverySMTPSection = section == null ? null : new DeliverySMTPSection(section);
} catch (Mix3BadServerFormatException e) { System.err.println(e); };
}
@@ -130,12 +130,12 @@ public class ServerDescriptor {
while ((indexOf = s.indexOf(',', indexFrom)) != -1) {
String v = s.substring(indexFrom, indexOf).trim();
- if (Packet.isPacketVersionSupported(v) || !onlySupported )
+ if (!v.equals("") && (Packet.isPacketVersionSupported(v) || !onlySupported ))
versions.add( v );
indexFrom = indexOf + 1;
}
String v = s.substring(indexFrom).trim();
- if (Packet.isPacketVersionSupported(v) || !onlySupported )
+ if (!v.equals("") && (Packet.isPacketVersionSupported(v) || !onlySupported ))
versions.add( v );
String[] result = new String[versions.size()];
@@ -223,7 +223,7 @@ public class ServerDescriptor {
identity = Base64.decode(entryIdentity.getValue());
digest = Base64.decode(entryDigest.getValue());
signature = Base64.decode(entrySignature.getValue());
- published = Util.parseDate(entryPublished.getValue());
+ published = Util.parseDateTime(entryPublished.getValue());
validAfter = Util.parseDate(entryValidAfter.getValue());
validUntil = Util.parseDate(entryValidUntil.getValue());
packetKey = new RSAPublicKey(Base64.decode(entryPacketKey.getValue()));
@@ -317,4 +317,41 @@ public class ServerDescriptor {
public RSAPublicKey getPacketKey() {
return packetKey;
}
+
+ /**
+ * Get the date after which this server descriptor is valid.
+ *
+ * @return date after which this server descriptor is valid
+ */
+ public Date getValidAfter() {
+ return validAfter;
+ }
+
+ /**
+ * Get the date until which this server descriptor is valid.
+ *
+ * @return date until which this server descriptor is valid
+ */
+ public Date getValidUntil() {
+ return validUntil;
+ }
+
+ /**
+ * Get the date when this server descriptor was published.
+ *
+ * @return date when this server descriptor was published
+ */
+ public Date getPublished() {
+ return published;
+ }
+
+ /**
+ * Get the Incoming/MMTP section.
+ *
+ * @return this server descriptor's Incoming/MMTP section
+ */
+ public IncomingMMTPSection getIncomingMMTPSection() {
+ return incomingMMTPSection;
+ }
+
}