public class FileTypeDetector extends Object
FileTypeDetector is used for detecting file types.| Constructor and Description |
|---|
FileTypeDetector() |
| Modifier and Type | Method and Description |
|---|---|
String |
detectFileType(org.apache.twill.filesystem.Location location)
Attempts to detect the type of the file through extensions and by reading the content of the file.
|
String |
detectFileType(String location)
Attempts to detect the type of the file through extensions and by reading the content of the file.
|
boolean |
isWrangleable(String type)
This function checks if the type is wrangle-able of not.
|
public static final String UNKNOWN
public boolean isWrangleable(String type)
It detects it based on the type, currently we only support types that are of MIME type 'text'
type - Specifies the MIME type.public String detectFileType(org.apache.twill.filesystem.Location location)
location - of the file who's content type need to be detected.Copyright © 2020 CDAP Licensed under the Apache License, Version 2.0.