library/src/main/java/com/github/lykmapipo/retrofit/HttpService.java
public static synchronized String mimeTypeFor(@NonNull File file) {
        try {
            String extension = extensionOf(file.getName()).substring(1);
            MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton();
            String mimeType = mimeTypeMap.getMimeTypeFromExtension(extension);
            if (TextUtils.isEmpty(mimeType)) {
                return "application/octet-stream";
            }
            return mimeType;
        } catch (Exception e) {
            return "application/octet-stream";
        }
    }
/**
     * Obtain MIME type for the given file.
     *
     * @return
     * @since 0.6.0
     */
Obtain MIME type for the given file.
Obtain MIME type for the given file .
public static synchronized String mimeTypeFor(@NonNull File file) {
        try {
            String extension = extensionOf(file.getName()).substring(1);
            MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton();
            String mimeType = mimeTypeMap.getMimeTypeFromExtension(extension);
            if (TextUtils.isEmpty(mimeType)) {
                return "application/octet-stream";
            }
            return mimeType;
        } catch (Exception e) {
            return "application/octet-stream";
        }
    }
public static synchronized String mimeTypeFor ( @ NonNull File file ) { try { String extension = extensionOf ( file . getName ( ) ) . substring ( 1 ) ; MimeTypeMap mimeTypeMap = MimeTypeMap . getSingleton ( ) ; String mimeType = mimeTypeMap . getMimeTypeFromExtension ( extension ) ; if ( TextUtils . isEmpty ( mimeType ) ) { return "application/octet-stream" ; } return mimeType ; } catch ( Exception e ) { return "application/octet-stream" ; } }
Obtain MIME type for the given file.
Obtain MIME type for the given file .