Package org.alfresco.encoding
Class TikaCharsetFinder
java.lang.Object
org.alfresco.encoding.AbstractCharactersetFinder
org.alfresco.encoding.TikaCharsetFinder
- All Implemented Interfaces:
CharactersetFinder
Uses Apache Tika as a fallback encoding detector
- Since:
- 3.4
- Author:
- Nick Burch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Charset
detectCharsetImpl
(byte[] buffer) int
Return the matching threshold before we decide that what we detected is a good match.void
setThreshold
(int threshold) At what point do we decide our match is good enough? In the range 0-100.Methods inherited from class org.alfresco.encoding.AbstractCharactersetFinder
detectCharset, detectCharset, getBufferSize, setBufferSize
-
Constructor Details
-
TikaCharsetFinder
public TikaCharsetFinder()
-
-
Method Details
-
detectCharsetImpl
- Specified by:
detectCharsetImpl
in classAbstractCharactersetFinder
- Throws:
Exception
-
getThreshold
public int getThreshold()Return the matching threshold before we decide that what we detected is a good match. In the range 0-100. -
setThreshold
public void setThreshold(int threshold) At what point do we decide our match is good enough? In the range 0-100. If we don't reach the threshold, we'll decline, and either another finder will work on it or the fallback encoding will be taken.
-