diff options
Diffstat (limited to 'tests/org.eclipse.jst.jsp.ui.tests/src/org/eclipse/jst/jsp/ui/tests/util/TimestampUtil.java')
-rw-r--r-- | tests/org.eclipse.jst.jsp.ui.tests/src/org/eclipse/jst/jsp/ui/tests/util/TimestampUtil.java | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/tests/org.eclipse.jst.jsp.ui.tests/src/org/eclipse/jst/jsp/ui/tests/util/TimestampUtil.java b/tests/org.eclipse.jst.jsp.ui.tests/src/org/eclipse/jst/jsp/ui/tests/util/TimestampUtil.java deleted file mode 100644 index a856dc990..000000000 --- a/tests/org.eclipse.jst.jsp.ui.tests/src/org/eclipse/jst/jsp/ui/tests/util/TimestampUtil.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.jsp.ui.tests.util; - -import java.util.Calendar; -import java.util.Date; - -import com.ibm.icu.text.DateFormat; -import com.ibm.icu.text.SimpleDateFormat; - -/** - * @author davidw - * - * This class provides one timestamp per VM run. - * (Technically, per class loading.) - */ -public class TimestampUtil { - - private static Date timestamp = null; - private static DateFormat shortFormat = new SimpleDateFormat("yyyy'-'MM'-'dd"); - // private static DateFormat longFormat = new SimpleDateFormat("yyyy'-'MM'-'dd'-'kk'-'mm'-'ss"); - - private static String nowShort = null; - - public static String timestamp() { - - if (TimestampUtil.nowShort == null) { - TimestampUtil.nowShort = shortFormat.format(ensureTimestamp()); - } - return TimestampUtil.nowShort; - } - - protected static Date ensureTimestamp() { - // just calculate 'timestamp' once per class loading, - // so this 'timestamp' remains the same during - // entire run. - if (TimestampUtil.timestamp == null) { - Calendar calendar = Calendar.getInstance(); - TimestampUtil.timestamp = calendar.getTime(); - } - return TimestampUtil.timestamp; - } - -}
\ No newline at end of file |