+
+
+ /**
+ * Use the given int values to create a timestamp
+ * @param inDate ints describing date
+ * @param inTime ints describing time
+ * @return Timestamp object corresponding to inputs
+ */
+ private static Timestamp createTimestamp(int[] inDate, int[] inTime)
+ {
+ if (inDate == null || inTime == null || inDate.length != 3 || inTime.length != 3) {
+ return null;
+ }
+ return new Timestamp(inDate[0], inDate[1], inDate[2],
+ inTime[0], inTime[1], inTime[2]);
+ }
+
+
+ /**
+ * Use the given String value to create a timestamp
+ * @param inStamp timestamp from exif
+ * @return Timestamp object corresponding to input
+ */
+ private static Timestamp createTimestamp(String inStamp)
+ {
+ Timestamp stamp = null;
+ try
+ {
+ stamp = new Timestamp(Integer.parseInt(inStamp.substring(0, 4)),
+ Integer.parseInt(inStamp.substring(5, 7)),
+ Integer.parseInt(inStamp.substring(8, 10)),
+ Integer.parseInt(inStamp.substring(11, 13)),
+ Integer.parseInt(inStamp.substring(14, 16)),
+ Integer.parseInt(inStamp.substring(17)));
+ }
+ catch (NumberFormatException nfe) {}
+ return stamp;
+ }