Package org.apache.http.client.utils
Class DateUtils.DateFormatHolder
java.lang.Object
org.apache.http.client.utils.DateUtils.DateFormatHolder
- Enclosing class:
- DateUtils
A factory for
SimpleDateFormats. The instances are stored in a
threadlocal way because SimpleDateFormat is not threadsafe as noted in
its javadoc.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ThreadLocal<SoftReference<Map<String,SimpleDateFormat>>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic SimpleDateFormatcreates aSimpleDateFormatfor the requested format string.
-
Field Details
-
THREADLOCAL_FORMATS
-
-
Constructor Details
-
DateFormatHolder
DateFormatHolder()
-
-
Method Details
-
formatFor
creates aSimpleDateFormatfor the requested format string.- Parameters:
pattern- a non-nullformat String according toSimpleDateFormat. The format is not checked againstnullsince all paths go throughDateUtils.- Returns:
- the requested format. This simple dateformat should not be used
to
applyto a different pattern.
-
clearThreadLocal
public static void clearThreadLocal()
-