Package com.avoka.fc.core.service
Interface IMediaTypeScanService
-
- All Known Implementing Classes:
FluentMediaTypeScanService
,TikaMediaTypeScanService
public interface IMediaTypeScanService
Provides an interface for scanning file attachments media type.- Since:
- 20.11.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
detectMediaType(String fileName, byte[] fileData)
Detects the media type of a given document.default boolean
isFileOfMediaType(String fileName, byte[] fileData, String mediaType)
Checks a given document if it is of a given media type.
-
-
-
Method Detail
-
detectMediaType
String detectMediaType(String fileName, byte[] fileData)
Detects the media type of a given document.- Parameters:
fileData
- the first few bytes of document data- Returns:
- media type of the document
-
isFileOfMediaType
default boolean isFileOfMediaType(String fileName, byte[] fileData, String mediaType)
Checks a given document if it is of a given media type.- Parameters:
fileName
- file namefileData
- the first few bytes of document datamediaType
- media type- Returns:
- true if a given document is of a given media type, otherwise false
-
-