Package org.cdlib.mrt.core
Class Tika
java.lang.Object
org.cdlib.mrt.core.Tika
Container class for Storage ERC content
- Author:
- dloy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.tika.mime.MediaTypegetMediaType(File componentFile) Return MediaType just using Fileorg.apache.tika.mime.MediaTypegetMediaType(InputStream componentStream, String filenameWithExtension) Returns a tika Media based on the input stream and file ExtensiongetMimeType(File componentFile) Get mime type using just a FilegetMimeType(InputStream componentStream, String fileID) static TikavoidsetTika(FileComponent component, File testFile, String fileID) Set mime type using TikavoidsetTika(FileComponent component, InputStream stream, String fileID) Set mime type using Tika
-
Field Details
-
logger
-
detector
protected org.apache.tika.detect.Detector detector -
mediaType
protected org.apache.tika.mime.MediaType mediaType -
alternates
-
keys
-
-
Constructor Details
-
Tika
- Throws:
TException
-
-
Method Details
-
getTika
- Throws:
TException
-
getMediaType
public org.apache.tika.mime.MediaType getMediaType(InputStream componentStream, String filenameWithExtension) throws TException Returns a tika Media based on the input stream and file Extension- Parameters:
componentStream- input streamfilenameWithExtension- name with extension- Returns:
- MediaType containing Mime Type
- Throws:
TException- Note that closing the InputStream is REQUIRED (this version) - not performed by Tika
-
getMediaType
Return MediaType just using File- Parameters:
componentFile-- Returns:
- Throws:
TException
-
getMimeType
Get mime type using just a File- Parameters:
componentFile-- Returns:
- MimeType
- Throws:
TException
-
getMimeType
- Throws:
TException
-
setTika
Set mime type using Tika- Parameters:
component- file component with componentFile set- Throws:
TException
-
setTika
Set mime type using Tika- Parameters:
component- file component with componentFile set- Throws:
TException
-