MagicMatch magic;
try {
magic = Magic.getMagicMatch(dataFile);
mimeType = magic.getMimeType();
} catch (MagicParseException e) {
throw new MimeTypeException(
"Ocorreu um erro ao tentar obter o tipo do arquivo", e);
} catch (MagicMatchNotFoundException e) {
throw new MimeTypeException(
"Ocorreu um erro ao tentar obter o tipo do arquivo", e);
} catch (MagicException e) {
throw new MimeTypeException(
"Ocorreu um erro ao tentar obter o tipo do arquivo", e);
}
return mimeType;
}