list of MIME types

Here is a list of MIME types, associated by type of documents, ordered by their common extensions.
Two primary MIME types are important for the role of default types:
  • text/plain is the default value for textual files. A textual file should be human-readable and must not contain binary data.
  • application/octet-stream is the default value for all other cases. An unknown file type should use this type. Browsers pay particular care when manipulating these files, attempting to safeguard the user to prevent dangerous behaviors.
IANA is the official registry of MIME media types and maintains a list of all the official MIME types. This table lists some important MIME types for the Web:
ExtensionKind of documentMIME Type
.aacAAC audioaudio/aac
.abwAbiWord documentapplication/x-abiword
.arcArchive document (multiple files embedded)application/x-freearc
.aviAVI: Audio Video Interleavevideo/x-msvideo
.azwAmazon Kindle eBook formatapplication/vnd.amazon.ebook
.binAny kind of binary dataapplication/octet-stream
.bmpWindows OS/2 Bitmap Graphicsimage/bmp
.bzBZip archiveapplication/x-bzip
.bz2BZip2 archiveapplication/x-bzip2
.cshC-Shell scriptapplication/x-csh
.cssCascading Style Sheets (CSS)text/css
.csvComma-separated values (CSV)text/csv
.docMicrosoft Wordapplication/msword
.docxMicrosoft Word (OpenXML)application/vnd.openxmlformats-officedocument.wordprocessingml.document
.eotMS Embedded OpenType fontsapplication/vnd.ms-fontobject
.epubElectronic publication (EPUB)application/epub+zip
.gifGraphics Interchange Format (GIF)image/gif
.htm
.html
HyperText Markup Language (HTML)text/html
.icoIcon formatimage/vnd.microsoft.icon
.icsiCalendar formattext/calendar
.jarJava Archive (JAR)application/java-archive
.jpeg
.jpg
JPEG imagesimage/jpeg
.jsJavaScripttext/javascript
.jsonJSON formatapplication/json
.jsonldJSON-LD formatapplication/ld+json
.mid
.midi
Musical Instrument Digital Interface (MIDI)audio/midi audio/x-midi
.mjsJavaScript moduletext/javascript
.mp3MP3 audioaudio/mpeg
.mpegMPEG Videovideo/mpeg
.mpkgApple Installer Packageapplication/vnd.apple.installer+xml
.odpOpenDocument presentation documentapplication/vnd.oasis.opendocument.presentation
.odsOpenDocument spreadsheet documentapplication/vnd.oasis.opendocument.spreadsheet
.odtOpenDocument text documentapplication/vnd.oasis.opendocument.text
.ogaOGG audioaudio/ogg
.ogvOGG videovideo/ogg
.ogxOGGapplication/ogg
.otfOpenType fontfont/otf
.pngPortable Network Graphicsimage/png
.pdfAdobe Portable Document Format (PDF)application/pdf
.pptMicrosoft PowerPointapplication/vnd.ms-powerpoint
.pptxMicrosoft PowerPoint (OpenXML)application/vnd.openxmlformats-officedocument.presentationml.presentation
.rarRAR archiveapplication/x-rar-compressed
.rtfRich Text Format (RTF)application/rtf
.shBourne shell scriptapplication/x-sh
.svgScalable Vector Graphics (SVG)image/svg+xml
.swfSmall web format (SWF) or Adobe Flash documentapplication/x-shockwave-flash
.tarTape Archive (TAR)application/x-tar
.tif
.tiff
Tagged Image File Format (TIFF)image/tiff
.tsMPEG transport streamvideo/mp2t
.ttfTrueType Fontfont/ttf
.txtText, (generally ASCII or ISO 8859-n)text/plain
.vsdMicrosoft Visioapplication/vnd.visio
.wavWaveform Audio Formataudio/wav
.webaWEBM audioaudio/webm
.webmWEBM videovideo/webm
.webpWEBP imageimage/webp
.woffWeb Open Font Format (WOFF)font/woff
.woff2Web Open Font Format (WOFF)font/woff2
.xhtmlXHTMLapplication/xhtml+xml
.xlsMicrosoft Excelapplication/vnd.ms-excel
.xlsxMicrosoft Excel (OpenXML)application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xmlXMLapplication/xml if not readable from casual users (RFC 3023, section 3)
text/xml if readable from casual users (RFC 3023, section 3)
.xulXULapplication/vnd.mozilla.xul+xml
.zipZIP archiveapplication/zip
.3gp3GPP audio/video containervideo/3gpp
audio/3gpp if it doesn't contain video
.3g23GPP2 audio/video containervideo/3gpp2
audio/3gpp2 if it doesn't contain video
.7z7-zip archiveapplication/x-7z-compressed

Sorting of ListMapStringObject using Comparator

Sorting a List using Comparator

package com.yash;


import java.util.ArrayList;

import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/*

 * Sort a List>
 */
public class ListMapStringObjectSorting {


  public static void main(String[] args) {

 
    Map map1 = new HashMap();
    map1.put("name", "Y");
    map1.put("num", 1);

      Map map2 = new HashMap();

    map2.put("name", "A");
    map2.put("num", 3);
    
    Map map3 = new HashMap();
    map3.put("name", "D");
    map3.put("num", 2);
    
    Map map4 = new HashMap();
    map4.put("name", "C");
    map4.put("num", 5);
    
    List> mapList = new ArrayList>();
    mapList.add(map1);
    mapList.add(map2);
    mapList.add(map3);
    mapList.add(map4);

      Collections.sort(mapList, new Comparator> () {

        public int compare(Map m1, Map m2) {
            return ((Integer) m1.get("num")).compareTo((Integer) m2.get("num")); //ascending order
            //return ((Integer) m2.get("num")).compareTo((Integer) m1.get("num")); //descending order
        }
    });
    //Sort by number
    //[{num=1, name=Y}, {num=2, name=D}, {num=3, name=A}, {num=5, name=C}]
    System.out.println(mapList);
    
    Collections.sort(mapList, new Comparator>() {
        public int compare(final Map o1, final Map o2) {
            return ((String) o1.get("name")).compareTo((String) o2.get("name")); //ascending order
        }
    });
    //Sort by name
    //[{num=3, name=A}, {num=5, name=C}, {num=2, name=D}, {num=1, name=Y}]
    
    System.out.println(mapList);
}

}



Iterate a list - List> :

    
for (Map map : mapList) {
        for (Map.Entry entry : map.entrySet()) {
            String key = entry.getKey();
            Object value = entry.getValue();
            System.out.println(key + " = " + value);
        }

   }