Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Fix for ALLCAPS mimetype check on some devices #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.io.FileFilter;
import java.text.DecimalFormat;
import java.util.Comparator;
import java.util.Locale;

/**
* @version 2009-07-03
Expand Down Expand Up @@ -144,7 +145,9 @@ public static File getPathWithoutFilename(File file) {
public static String getMimeType(File file) {

String extension = getExtension(file.getName());

// Convert the extension to lower case to ensure compatibility with MimeTypeMap on devices
// that use e.g. .MP4 for extension
extension = extension.toLowerCase(Locale.getDefault());
if (extension.length() > 0)
return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.substring(1));

Expand Down