/**
* Should this thread prefer event based over usermodel based extractors?
* Will only be used if the All Threads setting is null.
+ *
+ * <p>
+ * This uses ThreadLocals and these can leak resources when you have a lot of threads.
+ * </p>
+ *
+ * You should always try to call {@link #removeThreadPrefersEventExtractorsSetting()}.
+ *
+ * @see #setAllThreadsPreferEventExtractors
*/
public static void setThreadPrefersEventExtractors(boolean preferEventExtractors) {
ExtractorFactory.setThreadPrefersEventExtractors(preferEventExtractors);
}
+ /**
+ * Clears the setting for this thread made by {@link #setThreadPrefersEventExtractors(boolean) }
+ *
+ * @see #setThreadPrefersEventExtractors(boolean)
+ * @since POI 5.2.4
+ */
+ public static void removeThreadPrefersEventExtractorsSetting() {
+ ExtractorFactory.removeThreadPrefersEventExtractorsSetting();
+ }
+
/**
* Should all threads prefer event based over usermodel based extractors?
* If set, will take preference over the Thread level setting.
* Should this thread prefer event based over usermodel based extractors?
* Will only be used if the All Threads setting is null.
*
+ * <p>
+ * This uses ThreadLocals and these can leak resources when you have a lot of threads.
+ * </p>
+ *
+ * You should always try to call {@link #removeThreadPrefersEventExtractorsSetting()}.
+ *
* @param preferEventExtractors If this threads should prefer event based extractors.
*/
public static void setThreadPrefersEventExtractors(boolean preferEventExtractors) {
threadPreferEventExtractors.set(preferEventExtractors);
}
+ /**
+ * Clears the setting for this thread made by {@link #setThreadPrefersEventExtractors(boolean) }
+ *
+ * @see #setThreadPrefersEventExtractors(boolean)
+ * @since POI 5.2.4
+ */
+ public static void removeThreadPrefersEventExtractorsSetting() {
+ threadPreferEventExtractors.remove();
+ }
+
/**
* Should all threads prefer event based over usermodel based extractors?
* If set, will take preference over the Thread level setting.