| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
package com.drew.imaging; |
| 22 |
|
| 23 |
import com.drew.lang.annotations.NotNull; |
| 24 |
import com.drew.lang.annotations.Nullable; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
public enum FileType |
| 33 |
{ |
| 34 |
Unknown("Unknown", "Unknown", null), |
| 35 |
Jpeg("JPEG", "Joint Photographic Experts Group", "image/jpeg", "jpg", "jpeg", "jpe"), |
| 36 |
Tiff("TIFF", "Tagged Image File Format", "image/tiff", "tiff", "tif"), |
| 37 |
Psd("PSD", "Photoshop Document", "image/vnd.adobe.photoshop", "psd"), |
| 38 |
Png("PNG", "Portable Network Graphics", "image/png", "png"), |
| 39 |
Bmp("BMP", "Device Independent Bitmap", "image/bmp", "bmp"), |
| 40 |
Gif("GIF", "Graphics Interchange Format", "image/gif", "gif"), |
| 41 |
Ico("ICO", "Windows Icon", "image/x-icon", "ico"), |
| 42 |
Pcx("PCX", "PiCture eXchange", "image/x-pcx", "pcx"), |
| 43 |
Riff("RIFF", "Resource Interchange File Format", null), |
| 44 |
Wav("WAV", "Waveform Audio File Format", "audio/vnd.wave", "wav", "wave"), |
| 45 |
Avi("AVI", "Audio Video Interleaved", "video/vnd.avi", "avi"), |
| 46 |
WebP("WebP", "WebP", "image/webp", "webp"), |
| 47 |
QuickTime("MOV", "QuickTime Movie", "video/quicktime", "mov", "qt"), |
| 48 |
Mp4("MP4", "MPEG-4 Part 14", "video/mp4", "mp4", "m4a", "m4p", "m4b", "m4r", "m4v"), |
| 49 |
Heif("HEIF", "High Efficiency Image File Format", "image/heif", "heif", "heic"), |
| 50 |
Eps("EPS", "Encapsulated PostScript", "application/postscript", "eps", "epsf", "epsi"), |
| 51 |
Mp3("MP3", "MPEG Audio Layer III", "audio/mpeg", "mp3"), |
| 52 |
|
| 53 |
|
| 54 |
Arw("ARW", "Sony Camera Raw", null, "arw"), |
| 55 |
|
| 56 |
Crw("CRW", "Canon Camera Raw", null, "crw"), |
| 57 |
|
| 58 |
Cr2("CR2", "Canon Camera Raw", null, "cr2"), |
| 59 |
|
| 60 |
Nef("NEF", "Nikon Camera Raw", null, "nef"), |
| 61 |
|
| 62 |
Orf("ORF", "Olympus Camera Raw", null, "orf"), |
| 63 |
|
| 64 |
Raf("RAF", "FujiFilm Camera Raw", null, "raf"), |
| 65 |
|
| 66 |
Rw2("RW2", "Panasonic Camera Raw", null, "rw2"), |
| 67 |
|
| 68 |
Crx("CRX", "Canon Camera Raw", null, "cr3", "crm"), |
| 69 |
|
| 70 |
|
| 71 |
Aac("AAC", "Advanced Audio Coding", "audio/aac", "m4a"), |
| 72 |
Asf("ASF", "Advanced Systems Format", "video/x-ms-asf", "asf", "wma", "wmv"), |
| 73 |
Cfbf("CFBF", "Compound File Binary Format", null, (String[])null), |
| 74 |
Flv("FLV", "Flash Video", "video/x-flv", ".flv", ".f4v,"), |
| 75 |
Indd("INDD", "INDesign Document", "application/octet-stream", ".indd"), |
| 76 |
Mxf("MXF", "Material Exchange Format", "application/mxf", "mxf"), |
| 77 |
Pdf("PDF", "Portable Document Format", "application/pdf", "pdf"), |
| 78 |
Qxp("QXP", "Quark XPress Document", null, "qzp", "qxd"), |
| 79 |
Ram("RAM", "RealAudio", "audio/vnd.rn-realaudio", "aac", "ra"), |
| 80 |
Rtf("RTF", "Rich Text Format", "application/rtf", "rtf"), |
| 81 |
Sit("SIT", "Stuffit Archive", "application/x-stuffit", "sit"), |
| 82 |
Sitx("SITX", "Stuffit X Archive", "application/x-stuffitx", "sitx"), |
| 83 |
Swf("SWF", "Small Web Format", "application/vnd.adobe.flash-movie", "swf"), |
| 84 |
Vob("VOB", "Video Object", "video/dvd", ".vob"), |
| 85 |
Zip("ZIP", "ZIP Archive", "application/zip", ".zip", ".zipx"); |
| 86 |
|
| 87 |
@NotNull private final String _name; |
| 88 |
@NotNull private final String _longName; |
| 89 |
@Nullable private final String _mimeType; |
| 90 |
private final String[] _extensions; |
| 91 |
|
| 92 |
FileType(@NotNull String name, @NotNull String longName, @Nullable String mimeType, String... extensions) |
| 93 |
{ |
| 94 |
_name = name; |
| 95 |
_longName = longName; |
| 96 |
_mimeType = mimeType; |
| 97 |
_extensions = extensions; |
| 98 |
} |
| 99 |
|
| 100 |
@NotNull |
| 101 |
public String getName() |
| 102 |
{ |
| 103 |
return _name; |
| 104 |
} |
| 105 |
|
| 106 |
@NotNull |
| 107 |
public String getLongName() |
| 108 |
{ |
| 109 |
return _longName; |
| 110 |
} |
| 111 |
|
| 112 |
@Nullable |
| 113 |
public String getMimeType() |
| 114 |
{ |
| 115 |
return _mimeType; |
| 116 |
} |
| 117 |
|
| 118 |
@Nullable |
| 119 |
public String getCommonExtension() |
| 120 |
{ |
| 121 |
return (_extensions == null || _extensions.length == 0) ? null : _extensions[0]; |
| 122 |
} |
| 123 |
|
| 124 |
@Nullable |
| 125 |
public String[] getAllExtensions() |
| 126 |
{ |
| 127 |
return _extensions; |
| 128 |
} |
| 129 |
} |