Author: anil.saldhana(a)jboss.com
Date: 2010-11-02 16:00:47 -0400 (Tue, 02 Nov 2010)
New Revision: 512
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/XMLTimeUtil.java
Log:
add method to parse XMLGregorianCalendar from time string
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/XMLTimeUtil.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/XMLTimeUtil.java 2010-11-02
20:00:09 UTC (rev 511)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/XMLTimeUtil.java 2010-11-02
20:00:47 UTC (rev 512)
@@ -149,4 +149,24 @@
return false;
return true;
}
+
+ /**
+ * Given a string representing xml time, parse into {@code XMLGregorianCalendar}
+ * @param timeString
+ * @return
+ * @throws ConfigurationException
+ */
+ public static XMLGregorianCalendar parse( String timeString ) throws
ConfigurationException
+ {
+ DatatypeFactory factory = null;
+ try
+ {
+ factory = DatatypeFactory.newInstance();
+ }
+ catch (DatatypeConfigurationException e)
+ {
+ throw new ConfigurationException( e );
+ }
+ return factory.newXMLGregorianCalendar( timeString );
+ }
}
\ No newline at end of file
Show replies by date