aboutsummaryrefslogtreecommitdiff
path: root/common/src/main/java/at/gv/egovernment/moa
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java/at/gv/egovernment/moa')
-rw-r--r--common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java31
-rw-r--r--common/src/main/java/at/gv/egovernment/moa/util/SSLUtils.java3
2 files changed, 32 insertions, 2 deletions
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java
index 5f31809dd..88133832a 100644
--- a/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java
+++ b/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java
@@ -74,6 +74,37 @@ public class DateTimeUtils {
}
/**
+ * Builds a <code>dateTime</code> value from a <code>Calendar</code> value.
+ * @param cal the <code>Calendar</code> value
+ * @return the <code>dateTime</code> value
+ */
+ public static String buildDate(Calendar cal) {
+ StringWriter out = new StringWriter();
+ out.write("" + cal.get(Calendar.YEAR));
+ out.write("-");
+ out.write(to2DigitString(cal.get(Calendar.MONTH) + 1));
+ out.write("-");
+ out.write(to2DigitString(cal.get(Calendar.DAY_OF_MONTH)));
+ return out.toString();
+ }
+
+ /**
+ * Builds a <code>dateTime</code> value from a <code>Calendar</code> value.
+ * @param cal the <code>Calendar</code> value
+ * @return the <code>dateTime</code> value
+ */
+ public static String buildTime(Calendar cal) {
+ StringWriter out = new StringWriter();
+ out.write(to2DigitString(cal.get(Calendar.HOUR_OF_DAY)));
+ out.write(":");
+ out.write(to2DigitString(cal.get(Calendar.MINUTE)));
+ out.write(":");
+ out.write(to2DigitString(cal.get(Calendar.SECOND)));
+
+ return out.toString();
+ }
+
+ /**
* Converts month, day, hour, minute, or second value
* to a 2 digit String.
* @param number the month, day, hour, minute, or second value
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/SSLUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/SSLUtils.java
index 6d6aedb22..a7937b1bd 100644
--- a/common/src/main/java/at/gv/egovernment/moa/util/SSLUtils.java
+++ b/common/src/main/java/at/gv/egovernment/moa/util/SSLUtils.java
@@ -110,8 +110,7 @@ public class SSLUtils {
String clientKeyStorePassword)
throws IOException, GeneralSecurityException {
- //System.setProperty("javax.net.debug", "all");
- TrustManager[] tms = getTrustManagers(trustStore);
+ TrustManager[] tms = getTrustManagers(trustStore);
KeyManager[] kms = getKeyManagers(clientKeyStoreType, clientKeyStoreURL, clientKeyStorePassword);
SSLContext ctx = SSLContext.getInstance("TLS");
ctx.init(kms, tms, null);