From 6b3ef14a652f6be0d559365d2fd2c78a61524fec Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Fri, 17 Sep 2010 22:06:25 +0000
Subject: [PATCH] Minimize Historical Data (dsreplication/client side). The purge historical can be executed on the local server even when it is stopped. This is matches the functionality provided by utilities such import-ldif, backup, etc.
---
opends/src/server/org/opends/server/util/StaticUtils.java | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/opends/src/server/org/opends/server/util/StaticUtils.java b/opends/src/server/org/opends/server/util/StaticUtils.java
index fc1323a..f62d1f7 100644
--- a/opends/src/server/org/opends/server/util/StaticUtils.java
+++ b/opends/src/server/org/opends/server/util/StaticUtils.java
@@ -4121,11 +4121,23 @@
{
if (timeStr.endsWith("Z"))
{
- SimpleDateFormat dateFormat =
+ try
+ {
+ SimpleDateFormat dateFormat =
new SimpleDateFormat(DATE_FORMAT_GENERALIZED_TIME);
- dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
- dateFormat.setLenient(true);
- dateTime = dateFormat.parse(timeStr);
+ dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
+ dateFormat.setLenient(true);
+ dateTime = dateFormat.parse(timeStr);
+ }
+ catch (ParseException pe)
+ {
+ // Best effort: try with GMT time.
+ SimpleDateFormat dateFormat =
+ new SimpleDateFormat(DATE_FORMAT_GMT_TIME);
+ dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
+ dateFormat.setLenient(true);
+ dateTime = dateFormat.parse(timeStr);
+ }
}
else
{
--
Gitblit v1.10.0