Skip to content

Instantly share code, notes, and snippets.

@wyatt-herkamp
Created December 17, 2018 15:48
Show Gist options
  • Save wyatt-herkamp/96f436833789cf4c1e6dd252017aa110 to your computer and use it in GitHub Desktop.
Save wyatt-herkamp/96f436833789cf4c1e6dd252017aa110 to your computer and use it in GitHub Desktop.
An Enum of some common MimeTypes feel free to use.
public enum MimeTypes {
TEXT("text/plain"),
HTML("text/html"),
CSS("text/css"),
JPEG("image/jpeg"),
PNG("image/png"),
GIF("image/gif"),
BMP("image/bmp"),
WEBP("image/webp"),
MPEG("audio/mpeg"),
OGG("audio/ogg"),
MIDI("audio/midi"),
WEBM("audio/webm"),
WAV("audio/wav"),
MP4("video/mp4"),
JSON("application/json"),
JAVASCRIPT("application/javascript"),
ECMASCRIPT("application/ecmascript"),
OCTETSTREAM("application/octet-stream"),
XML("application/xml"),
XHTMLXML("application/xhtml+xml"),
VNDMSPowerPoint("application/vnd.mspowerpoint"),
PDF("application/pdf"),
SVG("image/svg+xml");
private String mimeType;
MimeTypes(String mimeType) {
this.mimeType = mimeType;
}
public String getMimeType() {
return mimeType;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment