Package org.alfresco.encoding
Class TikaCharsetFinder
- java.lang.Object
-
- org.alfresco.encoding.AbstractCharactersetFinder
-
- org.alfresco.encoding.TikaCharsetFinder
-
- All Implemented Interfaces:
CharactersetFinder
public class TikaCharsetFinder extends AbstractCharactersetFinder
Uses Apache Tika as a fallback encoding detector- Since:
- 3.4
- Author:
- Nick Burch
-
-
Constructor Summary
Constructors Constructor Description TikaCharsetFinder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Charset
detectCharsetImpl(byte[] buffer)
int
getThreshold()
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
-
-
-
-
Method Detail
-
detectCharsetImpl
protected Charset detectCharsetImpl(byte[] buffer) throws Exception
- 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.
-
-