author | Claus Gittinger <cg@exept.de> |
Mon, 31 Mar 2014 11:19:26 +0200 | |
changeset 3322 | 78576b7fa8c5 |
parent 3295 | c430566c334c |
child 3332 | 5ab088e3de36 |
permissions | -rw-r--r-- |
643 | 1 |
" |
2 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
1612 | 3 |
All Rights Reserved |
643 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
1410 | 12 |
"{ Package: 'stx:libview2' }" |
13 |
||
643 | 14 |
Object subclass:#MIMETypes |
1612 | 15 |
instanceVariableNames:'' |
1729 | 16 |
classVariableNames:'TypeToImageReaderClassMapping TypeToCommentStringMapping |
1979
0612875a95c1
acroread command from registry (win32)
Claus Gittinger <cg@exept.de>
parents:
1925
diff
changeset
|
17 |
TypeToFileSuffixMapping TypeToViewerApplicationMapping |
1729 | 18 |
SuffixToCommentStringMapping FileSuffixToTypeMapping |
1979
0612875a95c1
acroread command from registry (win32)
Claus Gittinger <cg@exept.de>
parents:
1925
diff
changeset
|
19 |
FilenameToTypeMapping FileSuffixToImageReaderClassMapping |
0612875a95c1
acroread command from registry (win32)
Claus Gittinger <cg@exept.de>
parents:
1925
diff
changeset
|
20 |
CharSetToFontMapping LastSuffix LastType |
2298 | 21 |
DefaultCommandPerMIMEPerOS DefaultPrintCommandPerMIMEPerOS |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
22 |
TypeToParenthesisSpecMapping SuffixToParenthesisSpecMapping' |
1612 | 23 |
poolDictionaries:'' |
1800 | 24 |
category:'Net-Communication-Support' |
1612 | 25 |
! |
26 |
||
27 |
String variableByteSubclass:#MIMEType |
|
28 |
instanceVariableNames:'' |
|
29 |
classVariableNames:'CachedTypes' |
|
30 |
poolDictionaries:'' |
|
31 |
privateIn:MIMETypes |
|
643 | 32 |
! |
33 |
||
34 |
!MIMETypes class methodsFor:'documentation'! |
|
35 |
||
36 |
copyright |
|
37 |
" |
|
38 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
1612 | 39 |
All Rights Reserved |
643 | 40 |
|
41 |
This software is furnished under a license and may be used |
|
42 |
only in accordance with the terms of that license and with the |
|
43 |
inclusion of the above copyright notice. This software may not |
|
44 |
be provided or otherwise made available to, or used by, any |
|
45 |
other person. No title to or ownership of the software is |
|
46 |
hereby transferred. |
|
47 |
||
48 |
||
49 |
" |
|
50 |
! |
|
51 |
||
52 |
documentation |
|
53 |
" |
|
54 |
just a place to keep MIME information |
|
55 |
(avoid spreading things at many places) |
|
56 |
||
1021 | 57 |
MIMETypes is abstract and functional. |
58 |
Actually, in some OperatingSystems, this information may |
|
59 |
be found in some config files (or registries). |
|
60 |
Therefore, this class may have to be extended to support this |
|
61 |
and fetch the information from there eventually. |
|
62 |
||
643 | 63 |
[author:] |
64 |
Claus Gittinger |
|
65 |
" |
|
1311 | 66 |
! |
67 |
||
2486
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
68 |
examples |
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
69 |
" |
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
70 |
[exBegin] |
3210 | 71 |
MIMETypes mimeTypeFromString:'text/plain' |
72 |
[exEnd] |
|
73 |
[exBegin] |
|
2487
eaa224da42fa
mimeType: x-expecco-testsuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2486
diff
changeset
|
74 |
MIMETypes mimeTypeFromString:'application/x-expecco-testsuite' |
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
75 |
[exEnd] |
2486
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
76 |
|
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
77 |
[exBegin] |
2486
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
78 |
MIMETypes mimeTypeForSuffix:'gif' |
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
79 |
MIMETypes mimeTypeForSuffix:'ets' |
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
80 |
MIMETypes mimeTypeForSuffix:'xlsx' |
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
81 |
[exEnd] |
2486
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
82 |
" |
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
83 |
! |
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
84 |
|
1311 | 85 |
knownTypes |
86 |
" |
|
87 |
simply a reminder for me ... |
|
88 |
||
89 |
application mime file extentsions |
|
90 |
||
91 |
powerpoint application/ms-powerpoint .pot, .ppz, .ppt, .pps, |
|
92 |
application/mspowerpoint |
|
93 |
application/vnd.ms-powerpoint |
|
94 |
application/x-mspowerpoint |
|
95 |
||
1312 | 96 |
shockwave application/x-shockwave-flash .swf |
1311 | 97 |
|
1312 | 98 |
futuresplash application/futuresplash .spl |
1311 | 99 |
" |
643 | 100 |
! ! |
101 |
||
102 |
!MIMETypes class methodsFor:'initialization'! |
|
103 |
||
1729 | 104 |
initialize |
105 |
"initialize wellKnown facts" |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
106 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
107 |
MIMEType initialize. "must be initialized first" |
1729 | 108 |
LastSuffix := LastType := nil. |
109 |
self initializeFileNameToMimeTypeMapping. |
|
110 |
self initializeImageReaderMappings. |
|
111 |
self initializeCommentStringMappings. |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
112 |
self initializeParenthesisSpecMappings. |
1729 | 113 |
|
114 |
" |
|
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
115 |
self initialize |
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
116 |
" |
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
117 |
|
2298 | 118 |
"Modified: / 10-04-2007 / 15:16:44 / cg" |
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
119 |
"Modified (comment): / 29-11-2011 / 19:11:51 / cg" |
1729 | 120 |
! |
121 |
||
122 |
initializeCommentStringMappings |
|
123 |
TypeToCommentStringMapping := Dictionary new. |
|
124 |
SuffixToCommentStringMapping := Dictionary new. |
|
125 |
||
126 |
TypeToCommentStringMapping |
|
127 |
at:'application/x-make' |
|
128 |
put:#('#' (nil nil)). "/ '#' for EOL comments only |
|
129 |
||
130 |
TypeToCommentStringMapping |
|
131 |
at:'application/x-sh' |
|
132 |
put:#('#' (nil nil)). "/ '#' for EOL comments only |
|
133 |
||
2489
b891d96fd496
elf extension: x-expecco-logfile
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
134 |
#('text/html' 'text/xml' |
b891d96fd496
elf extension: x-expecco-logfile
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
135 |
'application/xml' |
b891d96fd496
elf extension: x-expecco-logfile
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
136 |
'application/x-expecco-testsuite' |
b891d96fd496
elf extension: x-expecco-logfile
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
137 |
'application/x-expecco-logfile' |
b891d96fd496
elf extension: x-expecco-logfile
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
138 |
) |
1729 | 139 |
do:[:eachXMLType | |
140 |
TypeToCommentStringMapping |
|
141 |
at:eachXMLType |
|
142 |
put:#(nil ('<!!-- ' ' -->')). "/ '<!!-- ... -->' delimited comments only |
|
143 |
]. |
|
144 |
||
145 |
TypeToCommentStringMapping |
|
2055 | 146 |
at:'text/css' |
147 |
put:#('//' ('/*' '*/')). |
|
148 |
||
149 |
TypeToCommentStringMapping |
|
1729 | 150 |
at:'application/x-batch-script' |
2937
67ef44218dc0
changed: #initializeCommentStringMappings
Claus Gittinger <cg@exept.de>
parents:
2924
diff
changeset
|
151 |
put:#('@REM ' '@rem ' 'REM ' 'rem ' (nil nil)). "/ 'rem ' for EOL comments only |
1729 | 152 |
|
153 |
"/ the following is ST/X specific |
|
154 |
TypeToCommentStringMapping |
|
155 |
at:'application/x-smalltalk-source' |
|
156 |
put:#('"/' ('"' '"')). "/ '"/ ' for EOL; ".." for delimited comments |
|
157 |
||
2055 | 158 |
|
1729 | 159 |
"/ this is for standard smalltalk |
160 |
"/ TypeToCommentStringMapping |
|
161 |
"/ at:'application/x-smalltalk-source' |
|
162 |
"/ put:#(nil ('"' '"')). "/ ".." for delimited comments only |
|
163 |
||
164 |
||
165 |
TypeToCommentStringMapping |
|
166 |
at:'application/x-pascal-source' |
|
167 |
put:#(nil ('{' '}')). "/ '{'..'}' for delimited comments |
|
168 |
||
2055 | 169 |
|
2048
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
170 |
"/ "/ the following is k&r |
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
171 |
"/ TypeToCommentStringMapping |
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
172 |
"/ at:'application/x-c-source' |
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
173 |
"/ put:#(nil ('/*' '*/')). "/ '/*'..'*/' for delimited comments |
1729 | 174 |
"/ this is ANSI-c |
175 |
TypeToCommentStringMapping |
|
176 |
at:'application/x-c-source' |
|
177 |
put:#('//' ('/*' '*/')). |
|
178 |
||
179 |
TypeToCommentStringMapping |
|
180 |
at:'application/x-cpp-source' |
|
181 |
put:#('//' ('/*' '*/')). |
|
182 |
||
183 |
TypeToCommentStringMapping |
|
2479 | 184 |
at:'application/x-csharp-source' |
185 |
put:#('//' ('/*' '*/')). |
|
186 |
||
187 |
TypeToCommentStringMapping |
|
1729 | 188 |
at:'application/x-java-source' |
189 |
put:#('//' ('/*' '*/')). |
|
190 |
||
191 |
TypeToCommentStringMapping |
|
2048
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
192 |
at:'application/x-javascript' |
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
193 |
put:#('//' ('/*' '*/')). |
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
194 |
|
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
195 |
TypeToCommentStringMapping |
2298 | 196 |
at:'application/x-lisp-source' |
197 |
put:#(';' (nil nil)). "/ '#' for EOL comments only |
|
198 |
||
199 |
TypeToCommentStringMapping |
|
1729 | 200 |
at:'application/x-asn1-source' |
201 |
put:#('--' ('--' '--')). |
|
202 |
||
203 |
||
204 |
"/ st/x support files |
|
205 |
SuffixToCommentStringMapping |
|
206 |
at:'style' |
|
207 |
put:#(';' (nil nil)). |
|
1604 | 208 |
|
1729 | 209 |
SuffixToCommentStringMapping |
210 |
at:'rs' |
|
2298 | 211 |
put:#(';' (nil nil)). |
212 |
||
2937
67ef44218dc0
changed: #initializeCommentStringMappings
Claus Gittinger <cg@exept.de>
parents:
2924
diff
changeset
|
213 |
"Modified: / 06-09-2011 / 10:46:27 / cg" |
1729 | 214 |
! |
215 |
||
216 |
initializeDefaultCommands |
|
217 |
"TODO: move this to OS" |
|
218 |
||
3253 | 219 |
|unixCommands win32Commands unixPrintCommands win32PrintCommands listToTry| |
1729 | 220 |
|
221 |
DefaultCommandPerMIMEPerOS := Dictionary new. |
|
222 |
DefaultCommandPerMIMEPerOS at:#unix put:(unixCommands := Dictionary new). |
|
223 |
DefaultCommandPerMIMEPerOS at:#win32 put:(win32Commands := Dictionary new). |
|
224 |
||
3187 | 225 |
unixCommands at:'application/x-tar-compressed' put:'tar tvf -'. |
1729 | 226 |
|
2141 | 227 |
OperatingSystem isMSWINDOWSlike ifFalse:[ |cmd| |
3253 | 228 |
OperatingSystem isOSXlike ifTrue:[ |
3322 | 229 |
unixCommands at:'text/html' put:('open -a Safari "%1"'). |
230 |
unixCommands at:'application/pdf' put:('open -a Preview "%1"'). |
|
3253 | 231 |
] ifFalse:[ |
3322 | 232 |
listToTry := #('firefox' 'chrome' 'chromium' 'konqueror' 'opera'). |
233 |
cmd := listToTry |
|
234 |
detect:[:aCmd| (OperatingSystem pathOfCommand:aCmd) notEmptyOrNil ] |
|
235 |
ifNone:nil. |
|
236 |
cmd notNil ifTrue:[ |
|
237 |
unixCommands at:'text/html' put:(cmd, ' "%1"') |
|
238 |
]. |
|
3187 | 239 |
|
3322 | 240 |
listToTry := #('acroread' 'okular' 'evince' 'kpdf' 'xpdf'). |
241 |
cmd := listToTry |
|
242 |
detect:[:aCmd| (OperatingSystem pathOfCommand:aCmd) notEmptyOrNil ] |
|
243 |
ifNone:nil. |
|
244 |
cmd notNil ifTrue:[ |
|
245 |
unixCommands at:'application/pdf' put:(cmd, ' "%1"') |
|
246 |
]. |
|
3187 | 247 |
]. |
2141 | 248 |
]. |
249 |
||
250 |
||
2116 | 251 |
DefaultPrintCommandPerMIMEPerOS := Dictionary new. |
252 |
DefaultPrintCommandPerMIMEPerOS at:#unix put:(unixPrintCommands := Dictionary new). |
|
253 |
DefaultPrintCommandPerMIMEPerOS at:#win32 put:(win32PrintCommands := Dictionary new). |
|
254 |
||
255 |
"/ if you have a good (intelligent) spooler ;-) |
|
2904
bb555534881e
changed: #initializeDefaultCommands
Stefan Vogel <sv@exept.de>
parents:
2892
diff
changeset
|
256 |
unixPrintCommands at:'application/pdf' put:'lpr "%1"'. |
2116 | 257 |
"/ if not, you may need more... |
258 |
"/ unixPrintCommands at:'application/pdf' put:'pdfToPS %1 | lpr'. |
|
259 |
||
1729 | 260 |
" |
261 |
self initializeDefaultCommands |
|
262 |
" |
|
1979
0612875a95c1
acroread command from registry (win32)
Claus Gittinger <cg@exept.de>
parents:
1925
diff
changeset
|
263 |
|
0612875a95c1
acroread command from registry (win32)
Claus Gittinger <cg@exept.de>
parents:
1925
diff
changeset
|
264 |
"Modified: / 12-05-2004 / 11:43:23 / cg" |
1729 | 265 |
! |
266 |
||
267 |
initializeFileNameToMimeTypeMapping |
|
268 |
"initialize wellKnown facts" |
|
269 |
||
270 |
|types| |
|
271 |
||
272 |
FileSuffixToTypeMapping isNil ifTrue:[ |
|
273 |
FileSuffixToTypeMapping := Dictionary new |
|
274 |
]. |
|
1887 | 275 |
TypeToFileSuffixMapping isNil ifTrue:[ |
276 |
TypeToFileSuffixMapping := Dictionary new |
|
277 |
]. |
|
1729 | 278 |
FilenameToTypeMapping isNil ifTrue:[ |
279 |
FilenameToTypeMapping := Dictionary new. |
|
280 |
]. |
|
281 |
||
282 |
types := OrderedCollection new. |
|
283 |
types addAll:self textTypeList. |
|
284 |
types addAll:self imageTypeList. |
|
285 |
types addAll:self videoTypeList. |
|
286 |
types addAll:self audioTypeList. |
|
287 |
types addAll:self applicationTypeList. |
|
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
288 |
types addAll:self osSpecificTypeList. |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
289 |
|
1729 | 290 |
types pairWiseDo:[:suff :typeString| |
291 |
|type| |
|
292 |
||
293 |
type := MIMEType fromString:typeString. |
|
294 |
suff isArray ifTrue:[ |
|
1887 | 295 |
suff do:[:s | FileSuffixToTypeMapping at:s put:type]. |
296 |
TypeToFileSuffixMapping at:type put:suff first. |
|
1729 | 297 |
] ifFalse:[ |
1887 | 298 |
FileSuffixToTypeMapping at:suff put:type. |
299 |
TypeToFileSuffixMapping at:type put:suff. |
|
300 |
]. |
|
1729 | 301 |
]. |
302 |
||
303 |
self miscFilenameList pairWiseDo:[:nm :typeString| |
|
304 |
|type| |
|
305 |
||
306 |
type := MIMEType fromString:typeString. |
|
307 |
nm isArray ifTrue:[ |
|
308 |
nm do:[:s | FilenameToTypeMapping at:s put:type] |
|
309 |
] ifFalse:[ |
|
310 |
FilenameToTypeMapping at:nm put:type |
|
311 |
] |
|
312 |
]. |
|
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
313 |
|
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
314 |
" |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
315 |
self initializeFileNameToMimeTypeMapping |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
316 |
" |
1729 | 317 |
! |
318 |
||
319 |
initializeImageReaderMappings |
|
3295 | 320 |
|rdr| |
321 |
||
1729 | 322 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[ |
323 |
FileSuffixToImageReaderClassMapping := Dictionary new |
|
324 |
]. |
|
325 |
"MIME" TypeToImageReaderClassMapping isNil ifTrue:[ |
|
326 |
TypeToImageReaderClassMapping := Dictionary new |
|
327 |
]. |
|
328 |
||
329 |
"/ setup mimeType to image reader class mapping ... |
|
330 |
TypeToImageReaderClassMapping at:'image/jpeg' put:JPEGReader. |
|
331 |
TypeToImageReaderClassMapping at:'image/gif' put:GIFReader. |
|
332 |
TypeToImageReaderClassMapping at:'image/tiff' put:TIFFReader. |
|
2710 | 333 |
TypeToImageReaderClassMapping at:'image/png' put:PNGReader. |
1729 | 334 |
|
335 |
"/ setup suffix to image reader class mapping ... |
|
336 |
FileSuffixToImageReaderClassMapping at:'jpg' put:JPEGReader. |
|
3295 | 337 |
FileSuffixToImageReaderClassMapping at:'jpeg' put:JPEGReader. |
1729 | 338 |
FileSuffixToImageReaderClassMapping at:'gif' put:GIFReader. |
339 |
FileSuffixToImageReaderClassMapping at:'tif' put:TIFFReader. |
|
3295 | 340 |
FileSuffixToImageReaderClassMapping at:'tiff' put:TIFFReader. |
2710 | 341 |
FileSuffixToImageReaderClassMapping at:'png' put:PNGReader. |
2570 | 342 |
|
3295 | 343 |
"/ some 'used-to-be-optional' readers |
344 |
(rdr := Smalltalk at:#WindowsIconReader) notNil ifTrue:[ |
|
345 |
TypeToImageReaderClassMapping at:'image/bmp' put:rdr. |
|
346 |
TypeToImageReaderClassMapping at:'image/x-MS-bmp' put:rdr. |
|
347 |
TypeToImageReaderClassMapping at:'image/x-MS-ico' put:rdr. |
|
348 |
FileSuffixToImageReaderClassMapping at:'bmp' put:rdr. |
|
349 |
FileSuffixToImageReaderClassMapping at:'ico' put:rdr. |
|
350 |
]. |
|
351 |
(rdr := Smalltalk at:#XBMReader) notNil ifTrue:[ |
|
352 |
TypeToImageReaderClassMapping at:'image/x-xbitmap' put:rdr. |
|
353 |
FileSuffixToImageReaderClassMapping at:'xbm' put:rdr. |
|
354 |
]. |
|
355 |
(rdr := Smalltalk at:#XPMReader) notNil ifTrue:[ |
|
356 |
TypeToImageReaderClassMapping at:'image/x-xpixmap' put:rdr. |
|
357 |
FileSuffixToImageReaderClassMapping at:'pm' put:rdr. |
|
358 |
]. |
|
359 |
(rdr := Smalltalk at:#PBMReader) notNil ifTrue:[ |
|
360 |
TypeToImageReaderClassMapping at:'image/x-portable-pixmap' put:rdr. |
|
361 |
TypeToImageReaderClassMapping at:'image/x-portable-bitmap' put:rdr. |
|
362 |
TypeToImageReaderClassMapping at:'image/x-portable-graymap' put:rdr. |
|
363 |
TypeToImageReaderClassMapping at:'image/x-portable-anymap' put:rdr. |
|
364 |
FileSuffixToImageReaderClassMapping at:'ppm' put:rdr. |
|
365 |
FileSuffixToImageReaderClassMapping at:'pbm' put:rdr. |
|
366 |
FileSuffixToImageReaderClassMapping at:'pgm' put:rdr. |
|
367 |
FileSuffixToImageReaderClassMapping at:'pnm' put:rdr. |
|
368 |
]. |
|
369 |
(rdr := Smalltalk at:#PCXReader) notNil ifTrue:[ |
|
370 |
TypeToImageReaderClassMapping at:'image/x-pcx' put:rdr. |
|
371 |
FileSuffixToImageReaderClassMapping at:'pcx' put:rdr. |
|
372 |
]. |
|
373 |
(rdr := Smalltalk at:#TargaReader) notNil ifTrue:[ |
|
374 |
TypeToImageReaderClassMapping at:'image/x-targa' put:rdr. |
|
375 |
FileSuffixToImageReaderClassMapping at:'tga' put:rdr. |
|
376 |
]. |
|
377 |
(rdr := Smalltalk at:#XWDReader) notNil ifTrue:[ |
|
378 |
TypeToImageReaderClassMapping at:'image/x-xwindowdump' put:rdr. |
|
379 |
TypeToImageReaderClassMapping at:'image/x-windowdump' put:rdr. |
|
380 |
FileSuffixToImageReaderClassMapping at:'xwd' put:rdr. |
|
381 |
]. |
|
382 |
(rdr := Smalltalk at:#BlitImageReader) notNil ifTrue:[ |
|
383 |
TypeToImageReaderClassMapping at:'image/x-blitimage' put:rdr. |
|
384 |
FileSuffixToImageReaderClassMapping at:'48x48x1' put:rdr. |
|
385 |
]. |
|
386 |
(rdr := Smalltalk at:#IrisRGBReader) notNil ifTrue:[ |
|
387 |
TypeToImageReaderClassMapping at:'image/x-rgb' put:rdr. |
|
388 |
FileSuffixToImageReaderClassMapping at:'rgb' put:rdr. |
|
389 |
]. |
|
390 |
(rdr := Smalltalk at:#SunRasterReader) notNil ifTrue:[ |
|
391 |
TypeToImageReaderClassMapping at:'image/x-sunraster' put:rdr. |
|
392 |
FileSuffixToImageReaderClassMapping at:'im8' put:rdr. |
|
393 |
FileSuffixToImageReaderClassMapping at:'icon' put:rdr. |
|
2570 | 394 |
]. |
3295 | 395 |
(rdr := Smalltalk at:#ST80FormReader) notNil ifTrue:[ |
396 |
TypeToImageReaderClassMapping at:'image/x-st80-form' put:rdr. |
|
397 |
FileSuffixToImageReaderClassMapping at:'form' put:rdr. |
|
398 |
]. |
|
399 |
(rdr := Smalltalk at:#FaceReader) notNil ifTrue:[ |
|
400 |
TypeToImageReaderClassMapping at:'image/x-face' put:rdr. |
|
401 |
FileSuffixToImageReaderClassMapping at:'face' put:rdr. |
|
402 |
]. |
|
403 |
(rdr := Smalltalk at:#PCDReader) notNil ifTrue:[ |
|
404 |
TypeToImageReaderClassMapping at:'image/x-photo-cd' put:rdr. |
|
405 |
FileSuffixToImageReaderClassMapping at:'pcd' put:rdr. |
|
406 |
]. |
|
407 |
(rdr := Smalltalk at:#CMURasterReader) notNil ifTrue:[ |
|
408 |
TypeToImageReaderClassMapping at:'image/x-cmu-raster' put:rdr. |
|
409 |
FileSuffixToImageReaderClassMapping at:'ras' put:rdr. |
|
410 |
]. |
|
411 |
||
412 |
"/ movie formats - experimantal and not yet complete / finished / delivered |
|
413 |
"/ (rdr := Smalltalk at:#FLIReader) notNil ifTrue:[ |
|
414 |
"/ TypeToImageReaderClassMapping at:'video/x-fli' put:rdr. |
|
415 |
"/ FileSuffixToImageReaderClassMapping at:'fli' put:rdr. |
|
416 |
"/ ]. |
|
417 |
"/ (rdr := Smalltalk at:#AVIReader) notNil ifTrue:[ |
|
418 |
"/ TypeToImageReaderClassMapping at:'video/x-msvideo' put:rdr. |
|
419 |
"/ FileSuffixToImageReaderClassMapping at:'avi' put:rdr. |
|
420 |
"/ ]. |
|
421 |
"/ (rdr := Smalltalk at:#AVIReader) notNil ifTrue:[ |
|
422 |
"/ TypeToImageReaderClassMapping at:'video/x-msvideo' put:rdr. |
|
423 |
"/ FileSuffixToImageReaderClassMapping at:'avi' put:rdr. |
|
424 |
"/ ]. |
|
425 |
"/ (rdr := Smalltalk at:#QuickTimeReader) notNil ifTrue:[ |
|
426 |
"/ TypeToImageReaderClassMapping at:'video/quicktime' put:rdr. |
|
427 |
"/ FileSuffixToImageReaderClassMapping at:'qt' put:rdr. |
|
428 |
"/ FileSuffixToImageReaderClassMapping at:'mov' put:rdr. |
|
429 |
"/ FileSuffixToImageReaderClassMapping at:'moov' put:rdr. |
|
430 |
"/ ]. |
|
431 |
"/ (rdr := Smalltalk at:#MPEG2Reader) notNil ifTrue:[ |
|
432 |
"/ TypeToImageReaderClassMapping at:'video/x-mpeg2' put:rdr. |
|
433 |
"/ FileSuffixToImageReaderClassMapping at:'mpg2' put:rdr. |
|
434 |
"/ FileSuffixToImageReaderClassMapping at:'mpv2' put:rdr. |
|
435 |
"/ FileSuffixToImageReaderClassMapping at:'mp2v' put:rdr. |
|
436 |
"/ FileSuffixToImageReaderClassMapping at:'mp2' put:rdr. |
|
437 |
"/ ]. |
|
438 |
"/ (rdr := Smalltalk at:#MPEGReader) notNil ifTrue:[ |
|
439 |
"/ TypeToImageReaderClassMapping at:'video/mpeg' put:rdr. |
|
440 |
"/ FileSuffixToImageReaderClassMapping at:'mpg' put:rdr. |
|
441 |
"/ FileSuffixToImageReaderClassMapping at:'mpeg' put:rdr. |
|
442 |
"/ FileSuffixToImageReaderClassMapping at:'mpe' put:rdr. |
|
443 |
"/ FileSuffixToImageReaderClassMapping at:'mpv' put:rdr. |
|
444 |
"/ FileSuffixToImageReaderClassMapping at:'vps' put:rdr. |
|
445 |
"/ FileSuffixToImageReaderClassMapping at:'mpegv' put:rdr. |
|
446 |
"/ ]. |
|
447 |
"/ (rdr := Smalltalk at:#SGIMovieReader) notNil ifTrue:[ |
|
448 |
"/ TypeToImageReaderClassMapping at:'video/x-sgi-movie' put:rdr. |
|
449 |
"/ FileSuffixToImageReaderClassMapping at:'movie' put:rdr. |
|
450 |
"/ ]. |
|
2298 | 451 |
! |
452 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
453 |
initializeParenthesisSpecMappings |
2298 | 454 |
|spec| |
455 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
456 |
TypeToParenthesisSpecMapping := Dictionary new. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
457 |
SuffixToParenthesisSpecMapping := Dictionary new. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
458 |
|
2298 | 459 |
"/ ST/X spec |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
460 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
461 |
spec := IdentityDictionary new. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
462 |
spec at:#open put:#( $( $[ ${ ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
463 |
spec at:#close put:#( $) $] $} ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
464 |
spec at:#ignore put:#( $' $" '$[' '$]' '${' '$)' ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
465 |
spec at:#eolComment put:'"/'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
466 |
TypeToParenthesisSpecMapping at:'application/x-smalltalk-source' put:spec. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
467 |
|
2479 | 468 |
"/ XML & HTML |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
469 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
470 |
spec := IdentityDictionary new. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
471 |
spec at:#open put:#( $< ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
472 |
spec at:#close put:#( $> ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
473 |
spec at:#ignore put:#( $' $" '$[' '$]' '${' '$)' ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
474 |
#( 'text/html' 'text/xml' 'application/xml' ) do:[:eachXMLType | |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
475 |
TypeToParenthesisSpecMapping at:eachXMLType put:spec |
2298 | 476 |
]. |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
477 |
|
2479 | 478 |
"/ ANSI-c, Java, C# |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
479 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
480 |
spec := IdentityDictionary new. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
481 |
spec at:#open put:#( $( $[ ${ ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
482 |
spec at:#close put:#( $) $] $} ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
483 |
spec at:#ignore put:#( $' $" ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
484 |
spec at:#eolComment put:'//'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
485 |
TypeToParenthesisSpecMapping at:'application/x-c-source' put:spec. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
486 |
TypeToParenthesisSpecMapping at:'application/x-cpp-source' put:spec. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
487 |
TypeToParenthesisSpecMapping at:'application/x-csharp-source' put:spec. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
488 |
TypeToParenthesisSpecMapping at:'application/x-java-source' put:spec. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
489 |
TypeToParenthesisSpecMapping at:'application/x-javascript' put:spec. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
490 |
|
2298 | 491 |
"/ Lisp |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
492 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
493 |
spec := IdentityDictionary new. |
3039 | 494 |
spec at:#open put:#( $( $[ ). |
495 |
spec at:#close put:#( $) $] ). |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
496 |
spec at:#ignore put:#( $" ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
497 |
spec at:#eolComment put:';'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
498 |
TypeToParenthesisSpecMapping at:'application/x-lisp-source' put:spec. |
2298 | 499 |
|
500 |
"Created: / 10-04-2007 / 15:16:37 / cg" |
|
1729 | 501 |
! ! |
502 |
||
503 |
!MIMETypes class methodsFor:'initialization-lists'! |
|
504 |
||
505 |
applicationCompressorsAndArchiveTypeList |
|
1604 | 506 |
^ #( |
1890 | 507 |
'tar' 'application/x-tar' |
508 |
'gtar' 'application/x-gtar' |
|
1891 | 509 |
('tgz' 'tar.gz') 'application/x-tar-gzip-compressed' "/ 'application/x-tar-compressed' |
510 |
('tar.bz2') 'application/x-tar-bzip2-compressed' |
|
1890 | 511 |
'zip' 'application/x-zip-compressed' |
512 |
'bz2' 'application/x-bzip2-compressed' |
|
513 |
('gz' 'z') 'application/x-gzip-compressed' |
|
514 |
'cpio' 'application/x-cpio' |
|
515 |
'shar' 'application/x-shar' |
|
516 |
'jar' 'application/java-archive' |
|
517 |
'sar' 'application/x-squeak-archive' |
|
518 |
'sit' 'application/x-stuffit' |
|
519 |
'hqx' 'application/mac-binhex40' |
|
520 |
'cpt' 'application/mac-compactpro' |
|
1604 | 521 |
) |
522 |
! |
|
645 | 523 |
|
1609 | 524 |
applicationMiscTypeList |
525 |
"misc applications" |
|
526 |
||
527 |
^ #( |
|
528 |
('a' 'o' 'obj' ) 'application/binary' |
|
2968 | 529 |
('lic') 'application/license' |
1609 | 530 |
('dll' 'so') 'application/shared-library' |
2486
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
531 |
|
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
532 |
('ets') 'application/x-expecco-testsuite' |
3104 | 533 |
('etr') 'application/x-expecco-testrepository' |
2489
b891d96fd496
elf extension: x-expecco-logfile
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
534 |
('elf') 'application/x-expecco-logfile' |
2886
22b48a4da285
comment/format in: #initializeFileNameToMimeTypeMapping
sr
parents:
2830
diff
changeset
|
535 |
('expeccolicense') 'application/x-expecco-license' |
2888 | 536 |
('expeccopatch') 'application/x-expecco-patch' |
1609 | 537 |
) |
2886
22b48a4da285
comment/format in: #initializeFileNameToMimeTypeMapping
sr
parents:
2830
diff
changeset
|
538 |
|
2968 | 539 |
"Modified: / 03-11-2011 / 10:42:28 / sr" |
1609 | 540 |
! |
541 |
||
1604 | 542 |
applicationProgLangTypeList |
3020
3f9c74ff0975
changed: #applicationProgLangTypeList
Claus Gittinger <cg@exept.de>
parents:
3014
diff
changeset
|
543 |
"applications for programming languages" |
713 | 544 |
|
1604 | 545 |
^ #( |
1609 | 546 |
('st' 'cls' 'rc') 'application/x-smalltalk-source' |
1604 | 547 |
'sif' 'application/x-smalltalk-source-sif' |
1668 | 548 |
'pac' 'application/x-smalltalk-dolphin-package' |
1778 | 549 |
|
550 |
'sts' 'application/x-squeak-source' |
|
551 |
'pr' 'application/x-squeak-project' |
|
552 |
||
1604 | 553 |
'c' 'application/x-c-source' |
554 |
('cc' 'cpp') 'application/x-cpp-source' |
|
2479 | 555 |
'cs' 'application/x-csharp-source' |
1609 | 556 |
('h' 'hi') 'application/x-c-header' |
1604 | 557 |
('js' 'mocha') 'application/x-javascript' |
558 |
('java' 'jav') 'application/x-java-source' |
|
559 |
'sh' 'application/x-sh' |
|
560 |
'csh' 'application/x-csh' |
|
561 |
'tcl' 'application/x-tcl' |
|
562 |
'pl' 'application/x-perl' |
|
3020
3f9c74ff0975
changed: #applicationProgLangTypeList
Claus Gittinger <cg@exept.de>
parents:
3014
diff
changeset
|
563 |
'dart' 'application/x-dart' |
1604 | 564 |
'mak' 'application/x-make' |
565 |
'bat' 'application/x-batch-script' |
|
3008 | 566 |
('asn1' 'x409' 'gdmo' 'gdm') 'application/x-asn1-source' |
567 |
||
2912
f3466ea0810b
changed: #applicationProgLangTypeList
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
568 |
('lisp' 'lsp' 'scm' 'ss' |
f3466ea0810b
changed: #applicationProgLangTypeList
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
569 |
'arc' 'cl' 'brg') 'application/x-lisp-source' |
1604 | 570 |
) |
2298 | 571 |
|
3020
3f9c74ff0975
changed: #applicationProgLangTypeList
Claus Gittinger <cg@exept.de>
parents:
3014
diff
changeset
|
572 |
"Modified (comment): / 21-08-2012 / 20:55:13 / cg" |
1604 | 573 |
! |
1561 | 574 |
|
1604 | 575 |
applicationTextTypeList |
1606 | 576 |
"text applications" |
1604 | 577 |
|
578 |
^ #( |
|
579 |
('ps' 'eps') 'application/postscript' |
|
1778 | 580 |
"/ 'ai' 'application/postscript' |
1604 | 581 |
'pdf' 'application/pdf' |
582 |
'rtf' 'application/rtf' |
|
1778 | 583 |
"/ 'rtf' 'text/rtf' ???? |
3008 | 584 |
'ics' 'text/calendar' |
585 |
'doc' 'application/ms-word-document' |
|
1778 | 586 |
"/ 'doc' 'application/winword' |
587 |
'swf' 'application/x-shockwave-flash' |
|
588 |
('ppt' 'ppz' 'pot' 'pps') 'application/mspowerpoint' |
|
2028 | 589 |
'xls' 'application/x-excel' |
590 |
'slk' 'application/vnd.ms-excel' |
|
2911
7afaf1fdae8b
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
2904
diff
changeset
|
591 |
'txt' 'text/plain' |
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
592 |
'xlsx' 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
1604 | 593 |
) |
2911
7afaf1fdae8b
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
2904
diff
changeset
|
594 |
|
3008 | 595 |
"Modified: / 26-05-2012 / 15:27:30 / cg" |
1604 | 596 |
! |
597 |
||
598 |
applicationTypeList |
|
1606 | 599 |
"applications" |
1604 | 600 |
|
1729 | 601 |
|typeList| |
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
602 |
|
1729 | 603 |
typeList := OrderedCollection new. |
604 |
typeList addAll:self applicationProgLangTypeList. |
|
605 |
typeList addAll:self applicationTextTypeList. |
|
606 |
typeList addAll:self applicationCompressorsAndArchiveTypeList. |
|
607 |
typeList addAll:self applicationMiscTypeList. |
|
1616 | 608 |
|
1729 | 609 |
^ typeList |
1604 | 610 |
! |
611 |
||
612 |
audioTypeList |
|
1606 | 613 |
"audio formats ..." |
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
614 |
|
1604 | 615 |
^ #( |
1720 | 616 |
('au' 'snd') 'audio/basic' |
1778 | 617 |
('ra') 'audio/x-realaudio' |
618 |
('ram' 'rm') 'audio/x-pn-realaudio' |
|
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
619 |
"/ cg: see unixSpecific / windowsSpecific |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
620 |
"/ 'rpm' 'audio/x-pn-realaudio-plugin' |
3008 | 621 |
('mpa' 'mpega' 'mpga') 'audio/mpeg' |
1778 | 622 |
"/ 'mp3' 'audio/x-mp3' |
623 |
('mp3' 'mp2') 'audio/mpeg' |
|
1604 | 624 |
'wav' 'audio/x-wav' |
625 |
('aif' 'aiff' 'aifc') 'audio/x-aiff' |
|
1778 | 626 |
('midi' 'mid') 'audio/midi' |
1604 | 627 |
) |
3008 | 628 |
|
629 |
"Modified: / 26-05-2012 / 15:23:45 / cg" |
|
1604 | 630 |
! |
631 |
||
632 |
imageTypeList |
|
633 |
||
634 |
^ #( |
|
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
635 |
"/ image formats ... |
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
636 |
|
1216 | 637 |
('jpg' 'jpeg') 'image/jpeg' |
1188 | 638 |
'gif' 'image/gif' |
639 |
('tif' 'tiff') 'image/tiff' |
|
3295 | 640 |
('xbm' 'bm') 'image/x-xbitmap' |
1188 | 641 |
'xpm' 'image/x-xpixmap' |
1720 | 642 |
'png' 'image/png' |
1188 | 643 |
'pcd' 'image/x-photo-cd' |
644 |
'bmp' 'image/x-MS-bmp' |
|
645 |
'rgb' 'image/x-rgb' |
|
646 |
'ppm' 'image/x-portable-pixmap' |
|
647 |
'pgm' 'image/x-portable-graymap' |
|
648 |
'pbm' 'image/x-portable-bitmap' |
|
649 |
'pnm' 'image/x-portable-anymap' |
|
650 |
'xwd' 'image/x-xwindowdump' |
|
651 |
'ras' 'image/x-cmu-raster' |
|
1216 | 652 |
'tga' 'image/x-targa' |
2020 | 653 |
'ico' 'image/x-ico' |
1604 | 654 |
) |
655 |
! |
|
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
656 |
|
1609 | 657 |
miscFilenameList |
3104 | 658 |
"other formats (not by suffix, but by fileName instead) ..." |
1609 | 659 |
|
660 |
^ #( |
|
2113 | 661 |
('makefile' 'make.proto' 'make.spec' 'nt.mak') 'application/x-make' |
2830 | 662 |
('exe' 'bin' 'com') 'application/octet-stream' |
2113 | 663 |
('class') 'application/octet-stream' |
2375 | 664 |
('top') 'application/x-waltop-digital-notepad' |
1609 | 665 |
) |
666 |
! |
|
667 |
||
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
668 |
osSpecificTypeList |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
669 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
670 |
^ self windowsSpecificTypeList |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
671 |
]. |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
672 |
^ self unixSpecificTypeList |
2023 | 673 |
|
674 |
" |
|
675 |
self osSpecificTypeList |
|
676 |
" |
|
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
677 |
! |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
678 |
|
1604 | 679 |
textTypeList |
680 |
"/ misc text ... |
|
681 |
||
682 |
^ #( |
|
1887 | 683 |
('html' 'htm' 'shtml') 'text/html' |
1604 | 684 |
('txt' 'text') 'text/plain' |
1680 | 685 |
'xml' 'text/xml' |
1777 | 686 |
'css' 'text/css' |
2432 | 687 |
'csv' 'text/csv' |
1604 | 688 |
) |
689 |
! |
|
690 |
||
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
691 |
unixSpecificTypeList |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
692 |
|
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
693 |
^ #( |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
694 |
"/ cg: RPM is 'audio/x-pn-realaudio-plugin' for WIN32 |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
695 |
"/ and 'application/x-rpm' for Unix |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
696 |
'rpm' 'application/x-rpm' |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
697 |
) |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
698 |
! |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
699 |
|
1604 | 700 |
videoTypeList |
701 |
"/ video formats ... |
|
702 |
||
703 |
^ #( |
|
1720 | 704 |
('qt' 'mov' 'moov') 'video/quicktime' |
705 |
('mpv' 'mpegv' 'mpg' 'mpeg' 'mpe') 'video/mpeg' |
|
1604 | 706 |
'movie' 'video/x-sgi-movie' |
1820 | 707 |
('avi' 'wmv' 'asf') 'video/x-msvideo' |
1604 | 708 |
('mpv2' 'mp2v' 'mp2' 'mpeg2') 'video/x-mpeg2' |
1680 | 709 |
'rm' 'application/vnd.rn-realmedia' |
710 |
'rv' 'video/x-pn-realvideo' |
|
3295 | 711 |
'fli' 'video/x-fli' |
1778 | 712 |
) |
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
713 |
! |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
714 |
|
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
715 |
windowsSpecificTypeList |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
716 |
^ #( |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
717 |
"/ cg: RPM is 'audio/x-pn-realaudio-plugin' for WIN32 |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
718 |
"/ and 'application/x-rpm' for Unix |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
719 |
'rpm' 'audio/x-pn-realaudio-plugin' |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
720 |
) |
643 | 721 |
! ! |
722 |
||
1729 | 723 |
!MIMETypes class methodsFor:'obsolete'! |
1489 | 724 |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
725 |
defaultCommandForMimeType:mimeType |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
726 |
<resource: #obsolete> |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
727 |
self obsoleteMethodWarning:'use #defaultCommandTemplateToOpenMimeType:'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
728 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
729 |
^ self defaultCommandTemplateToOpenMimeType:mimeType |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
730 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
731 |
" |
2758
66e62ceecb67
comment/format in: #defaultCommandForMimeType:
Claus Gittinger <cg@exept.de>
parents:
2724
diff
changeset
|
732 |
MIMETypes defaultCommandTemplateToOpenMimeType:'application/pdf' |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
733 |
" |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
734 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
735 |
"Created: / 12-05-2004 / 11:09:22 / cg" |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
736 |
"Modified: / 12-05-2004 / 11:16:53 / cg" |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
737 |
! |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
738 |
|
1729 | 739 |
fontForCharset:aCharSetName |
740 |
"return the font-encoding for an iso-charset" |
|
1489 | 741 |
|
1981 | 742 |
<resource:#obsolete> |
1729 | 743 |
self obsoleteMethodWarning:'use FontDescription >> fontNamePatternForCharset:'. |
744 |
^ FontDescription fontNamePatternForCharset:aCharSetName. |
|
1489 | 745 |
|
746 |
" |
|
1729 | 747 |
MIMETypes fontForCharset:'iso2022-jp' |
748 |
MIMETypes fontForCharset:'euc-jp' |
|
1472 | 749 |
" |
750 |
||
1729 | 751 |
"Modified: / 1.8.1998 / 17:00:57 / cg" |
752 |
! ! |
|
1472 | 753 |
|
1729 | 754 |
!MIMETypes class methodsFor:'queries'! |
1472 | 755 |
|
647 | 756 |
defineImageType:mimeType suffix:aSuffix reader:aReaderClass |
757 |
"register an image reader." |
|
758 |
||
759 |
aSuffix notNil ifTrue:[ |
|
760 |
self imageReaderForSuffix:aSuffix put:aReaderClass. |
|
761 |
]. |
|
762 |
||
763 |
mimeType notNil ifTrue:[ |
|
764 |
self imageReaderForType:mimeType put:aReaderClass |
|
765 |
]. |
|
766 |
||
767 |
(aSuffix notNil and:[mimeType notNil]) ifTrue:[ |
|
768 |
self mimeTypeForSuffix:aSuffix put:mimeType |
|
769 |
]. |
|
770 |
! |
|
771 |
||
643 | 772 |
fileSuffixToImageReaderMapping |
1021 | 773 |
"return the suffix-to-imageReader mapping" |
774 |
||
643 | 775 |
^ FileSuffixToImageReaderClassMapping ? #() |
776 |
||
1021 | 777 |
"Modified: / 1.8.1998 / 17:00:11 / cg" |
643 | 778 |
! |
779 |
||
780 |
imageFileSuffixes |
|
1021 | 781 |
"return a collection with known file suffixes" |
782 |
||
643 | 783 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[^ #()]. |
784 |
^ FileSuffixToImageReaderClassMapping keys |
|
785 |
||
1021 | 786 |
"Created: / 30.6.1997 / 22:04:48 / cg" |
787 |
"Modified: / 1.8.1998 / 17:01:26 / cg" |
|
643 | 788 |
! |
789 |
||
3014
e6d9a204da08
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
3012
diff
changeset
|
790 |
mimeTypeForFilename:filenameOrString |
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
791 |
"given a filename, return the mime-type or nil, if unknown" |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
792 |
|
1780
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
793 |
|type filename lcFilename suff suff2| |
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
794 |
|
3014
e6d9a204da08
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
3012
diff
changeset
|
795 |
filename := filenameOrString asFilename. |
1474 | 796 |
|
797 |
lcFilename := filename baseName asLowercase. |
|
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
798 |
type := FilenameToTypeMapping at:lcFilename ifAbsent:nil. |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
799 |
type isNil ifTrue:[ |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
800 |
"/ allow for fallback ... |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
801 |
type := OperatingSystem mimeTypeForFilename:lcFilename. |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
802 |
"/ the special value #unknown is returned as nil; |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
803 |
"/ this avoids constant retry if a mimeType is not known in |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
804 |
"/ the OS. |
1275 | 805 |
"/ type isNil ifTrue:[ |
806 |
"/ FilenameToTypeMapping at:lcFilename put:#unknown |
|
807 |
"/ ]. |
|
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
808 |
]. |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
809 |
|
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
810 |
type == #unknown ifTrue:[ |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
811 |
type := nil. |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
812 |
]. |
1273
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
813 |
|
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
814 |
type isNil ifTrue:[ |
1473 | 815 |
suff := filename suffix. |
1273
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
816 |
suff size ~~ 0 ifTrue:[ |
1780
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
817 |
"/ sigh - special code for multiple-suffices... |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
818 |
"/ .tar.gz -> tgz |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
819 |
suff2 := filename withoutSuffix suffix. |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
820 |
suff2 size > 0 ifTrue:[ |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
821 |
type := self mimeTypeForSuffix:(suff2 , '.' , suff). |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
822 |
]. |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
823 |
type isNil ifTrue:[ |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
824 |
type := self mimeTypeForSuffix:suff |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
825 |
]. |
1273
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
826 |
] |
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
827 |
]. |
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
828 |
|
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
829 |
^ type |
1780
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
830 |
|
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
831 |
" |
2820 | 832 |
MIMETypes mimeTypeForFilename:'typeinst.dvi' |
833 |
MIMETypes mimeTypeForFilename:'foo.tar' |
|
834 |
MIMETypes mimeTypeForFilename:'foo.tgz' |
|
835 |
MIMETypes mimeTypeForFilename:'foo.tar.gz' |
|
2911
7afaf1fdae8b
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
2904
diff
changeset
|
836 |
MIMETypes mimeTypeForFilename:'foo.txt' |
1780
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
837 |
" |
2911
7afaf1fdae8b
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
2904
diff
changeset
|
838 |
|
7afaf1fdae8b
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
2904
diff
changeset
|
839 |
"Modified: / 10-05-2011 / 11:55:18 / cg" |
3014
e6d9a204da08
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
3012
diff
changeset
|
840 |
"Modified (format): / 28-07-2012 / 09:39:15 / cg" |
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
841 |
! |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
842 |
|
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
843 |
mimeTypeForFilename:filename put:mimeType |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
844 |
"register a mime type for a filename" |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
845 |
|
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
846 |
FilenameToTypeMapping isNil ifTrue:[ |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
847 |
FilenameToTypeMapping := Dictionary new |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
848 |
]. |
1612 | 849 |
FilenameToTypeMapping at:filename put:(MIMEType fromString:mimeType asLowercase) |
1611 | 850 |
! |
851 |
||
643 | 852 |
mimeTypeForSuffix:suffix |
1021 | 853 |
"given a file suffix, return the mime-type" |
854 |
||
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
855 |
|type lcSuffix| |
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
856 |
|
1837 | 857 |
suffix = LastSuffix ifTrue:[ |
858 |
^ LastType |
|
859 |
]. |
|
860 |
||
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
861 |
lcSuffix := suffix asLowercase. |
1837 | 862 |
type := FileSuffixToTypeMapping at:lcSuffix ifAbsent:nil. |
863 |
type isNil ifTrue:[ |
|
864 |
"/ allow for fallback ... |
|
865 |
type := OperatingSystem mimeTypeForSuffix:lcSuffix. |
|
866 |
"/ the special value #unknown is returned as nil; |
|
867 |
"/ this avoids constant retry if a mimeType is not known in the OS. |
|
868 |
||
869 |
type := type ? #unknown. |
|
870 |
FileSuffixToTypeMapping at:lcSuffix put:type. |
|
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
871 |
]. |
1837 | 872 |
|
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
873 |
type == #unknown ifTrue:[ |
1837 | 874 |
type := nil. |
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
875 |
]. |
1840 | 876 |
type notNil ifTrue:[ |
877 |
LastSuffix := suffix. |
|
878 |
LastType := MIMEType fromString:type. |
|
879 |
^ LastType |
|
880 |
]. |
|
1841 | 881 |
^ type |
643 | 882 |
|
1666 | 883 |
" |
1840 | 884 |
self mimeTypeForSuffix:'gif' |
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
885 |
self mimeTypeForSuffix:'rpm' |
2891 | 886 |
self mimeTypeForSuffix:'zip' |
1666 | 887 |
" |
888 |
||
2891 | 889 |
"Created: / 30-06-1997 / 21:55:51 / cg" |
890 |
"Modified: / 14-02-2011 / 17:14:34 / cg" |
|
643 | 891 |
! |
892 |
||
893 |
mimeTypeForSuffix:suffix put:mimeType |
|
1021 | 894 |
"register a mime type for a file suffix" |
895 |
||
643 | 896 |
FileSuffixToTypeMapping isNil ifTrue:[ |
897 |
FileSuffixToTypeMapping := Dictionary new |
|
898 |
]. |
|
899 |
FileSuffixToTypeMapping at:suffix put:mimeType asLowercase |
|
900 |
||
1021 | 901 |
"Created: / 30.6.1997 / 21:56:20 / cg" |
902 |
"Modified: / 1.8.1998 / 17:03:18 / cg" |
|
1593 | 903 |
! |
904 |
||
905 |
mimeTypeForSuffixMapping |
|
906 |
||
907 |
^ FileSuffixToTypeMapping |
|
1611 | 908 |
! |
909 |
||
2023 | 910 |
mimeTypeFromString:mimeTypeString |
911 |
"given a mime-type for a string" |
|
912 |
||
913 |
^ MIMEType fromString:mimeTypeString |
|
914 |
||
915 |
" |
|
916 |
self mimeTypeFromString:'image/gif' |
|
2487
eaa224da42fa
mimeType: x-expecco-testsuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2486
diff
changeset
|
917 |
self mimeTypeFromString:'application/x-expecco-testsuite' |
2023 | 918 |
" |
919 |
! |
|
920 |
||
1611 | 921 |
mimeTypeOfContents:filename |
922 |
"given a filename, scan the contents, return the mime-type or nil, if unknown" |
|
923 |
||
1612 | 924 |
|typeString| |
925 |
||
926 |
typeString := filename mimeTypeOfContents. |
|
927 |
typeString isNil ifTrue:[^ nil]. |
|
928 |
^ MIMEType fromString:typeString. |
|
1887 | 929 |
! |
930 |
||
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
931 |
mimeTypeOfData:someData |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
932 |
"this tries to guess the mime type of contents of someData. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
933 |
Returns nil, if unknown. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
934 |
This is done using some heuristics, and may need some improvement" |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
935 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
936 |
|buffer lcBuffer size idx idx2| |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
937 |
|
2583 | 938 |
someData isEmptyOrNil ifTrue:[^ nil]. |
939 |
||
940 |
size := 2048 min:someData size. |
|
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
941 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
942 |
"/ read some data from the file ... |
2583 | 943 |
buffer := (someData copyTo:size) asString. |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
944 |
lcBuffer := buffer asLowercase. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
945 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
946 |
(idx := lcBuffer findString:'mimetype:') ~~ 0 ifTrue:[ |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
947 |
idx := idx + 'mimetype:' size. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
948 |
idx := lcBuffer indexOfNonSeparatorStartingAt:idx. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
949 |
idx2 := lcBuffer indexOfSeparatorStartingAt:idx. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
950 |
idx2 > idx ifTrue:[ |
2583 | 951 |
^ MIMEType fromString:(lcBuffer copyFrom:idx to:idx2-1) |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
952 |
]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
953 |
]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
954 |
|
2924 | 955 |
"/ real starters |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
956 |
#( |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
957 |
( #[16r4C 16r00 16r00 16r00 16r01 16r14 16r02 16r00 16r00 16r00 16r00 16r00 16rC0 16r00 16r00 16r00 16r00 16r00 16r00 16r46] |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
958 |
#'application/x-ms-shortcut' ) |
2924 | 959 |
( 'ITOLITLS' |
960 |
#'application/x-ms-reader' ) |
|
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
961 |
( 'WALTOP' |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
962 |
#'application/x-waltop-digital-notepad' ) |
2892 | 963 |
('PK' |
964 |
#'application/x-zip-compressed') |
|
3113 | 965 |
('<?xml' |
966 |
#'text/xml') |
|
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
967 |
) pairsDo:[:pattern :what | |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
968 |
|patternString| |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
969 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
970 |
patternString := pattern asString. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
971 |
(buffer startsWith:patternString) ifTrue:[ |
2583 | 972 |
^ MIMEType fromString:what |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
973 |
] |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
974 |
]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
975 |
|
2924 | 976 |
"/ somewhere near the beginning |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
977 |
#( |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
978 |
('<body:' #'text/html') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
979 |
('%!!ps-adobe' #'application/postscript') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
980 |
('%PDF-' #'application/pdf') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
981 |
('#!! /bin/sh' #'application/x-sh') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
982 |
('#!!/bin/sh' #'application/x-sh') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
983 |
"/ ('#!! /bin/bash' 'application/x-bash') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
984 |
"/ ('#!!/bin/bash' 'application/x-bash') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
985 |
|
3113 | 986 |
('---- encoding: ' #'application/x-smalltalk-source') |
987 |
('---- timestamp ' #'application/x-smalltalk-source') |
|
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
988 |
('from dolphin' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
989 |
('from visualworks' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
990 |
('categoriesforclass' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
991 |
('methodsfor!!' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
992 |
('subclass:' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
993 |
('methodsfor:' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
994 |
('interchangeversion:' #'application/x-smalltalk-source-sif') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
995 |
('subclass:' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
996 |
('methodsfor:' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
997 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
998 |
) pairsDo:[:pattern :what | |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
999 |
(lcBuffer findString:pattern) ~~ 0 ifTrue:[ |
2583 | 1000 |
^ MIMEType fromString:what |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1001 |
] |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1002 |
]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1003 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1004 |
(idx := lcBuffer findString:'<h') ~~ 0 ifTrue:[ |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1005 |
((lcBuffer continuesWith:'<head' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1006 |
or:[(lcBuffer continuesWith:'<html' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1007 |
or:[(lcBuffer continuesWith:'<h1' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1008 |
or:[(lcBuffer continuesWith:'<h2' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1009 |
or:[(lcBuffer continuesWith:'<h3' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1010 |
or:[(lcBuffer continuesWith:'<h4' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1011 |
or:[(lcBuffer continuesWith:'<h5' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1012 |
or:[(lcBuffer continuesWith:'<h6' startingAt:idx)]]]]]]]) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1013 |
ifTrue:[ |
2583 | 1014 |
^ MIMEType fromString:'text/html' |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1015 |
] |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1016 |
]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1017 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1018 |
[size ~~ 0 and:[(buffer at:size) isPrintable]] whileTrue:[size := size - 1]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1019 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1020 |
size == 0 ifTrue:[ |
2583 | 1021 |
^ MIMEType fromString:'text/plain' |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1022 |
]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1023 |
^ nil |
2891 | 1024 |
|
2924 | 1025 |
"Modified: / 12-07-2011 / 19:08:17 / cg" |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1026 |
! |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1027 |
|
1887 | 1028 |
suffixForMimeType:mimeType |
1029 |
"given a file suffix, return the mime-type" |
|
1030 |
||
1031 |
^ TypeToFileSuffixMapping at:mimeType ifAbsent:nil |
|
1032 |
||
1033 |
" |
|
1034 |
self suffixForMimeType:(MIMEType fromString:'image/gif') |
|
1035 |
" |
|
1036 |
||
1037 |
"Created: / 30.6.1997 / 21:55:51 / cg" |
|
1038 |
"Modified: / 23.12.1999 / 22:30:55 / cg" |
|
1039 |
! |
|
1040 |
||
1041 |
suffixForMimeTypeString:mimeTypeString |
|
1042 |
"given a file suffix, return the mime-type" |
|
1043 |
||
1044 |
^ self suffixForMimeType:(MIMEType fromString:mimeTypeString) |
|
1045 |
||
1046 |
" |
|
1047 |
self suffixForMimeTypeString:'image/gif' |
|
1048 |
" |
|
1049 |
||
1050 |
"Created: / 30.6.1997 / 21:55:51 / cg" |
|
1051 |
"Modified: / 23.12.1999 / 22:30:55 / cg" |
|
1612 | 1052 |
! ! |
1053 |
||
2116 | 1054 |
!MIMETypes class methodsFor:'queries-applications'! |
1055 |
||
2117 | 1056 |
defaultCommandPerMIME |
1057 |
"returns the collection which is used to map MIME-type to command-templates." |
|
1058 |
||
1059 |
"TODO: move this to OS/UserPreferences" |
|
1060 |
||
1061 |
DefaultCommandPerMIMEPerOS isNil ifTrue:[ |
|
1062 |
self initializeDefaultCommands |
|
1063 |
]. |
|
1064 |
OperatingSystem isUNIXlike ifTrue:[ |
|
1065 |
^ DefaultCommandPerMIMEPerOS at:#unix |
|
1066 |
]. |
|
1067 |
^ DefaultCommandPerMIMEPerOS at:#win32 |
|
2942
693d381bc775
comment/format in: #defaultCommandPerMIME
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1068 |
|
693d381bc775
comment/format in: #defaultCommandPerMIME
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1069 |
" |
693d381bc775
comment/format in: #defaultCommandPerMIME
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1070 |
MIMETypes defaultCommandPerMIME |
693d381bc775
comment/format in: #defaultCommandPerMIME
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1071 |
" |
693d381bc775
comment/format in: #defaultCommandPerMIME
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1072 |
|
693d381bc775
comment/format in: #defaultCommandPerMIME
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1073 |
"Modified (comment): / 16-09-2011 / 16:20:12 / cg" |
2117 | 1074 |
! |
1075 |
||
2116 | 1076 |
defaultCommandTemplateToOpenMimeType:mimeType |
1077 |
|cmd| |
|
1078 |
||
1079 |
cmd := self defaultCommandPerMIME at:mimeType ifAbsent:nil. |
|
1080 |
cmd isNil ifTrue:[ |
|
1081 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
1082 |
cmd := Win32OperatingSystem::RegistryEntry commandTemplateToOpenMimeType:mimeType |
|
1083 |
]. |
|
1084 |
]. |
|
1085 |
^ cmd |
|
1086 |
||
1087 |
" |
|
1088 |
MIMETypes defaultCommandTemplateToOpenMimeType:'application/pdf' |
|
2118 | 1089 |
MIMETypes defaultCommandTemplateToOpenMimeType:'text/html' |
2116 | 1090 |
" |
1091 |
||
1092 |
"Created: / 12-05-2004 / 11:09:22 / cg" |
|
1093 |
"Modified: / 12-05-2004 / 11:16:53 / cg" |
|
1094 |
! |
|
1095 |
||
1096 |
defaultCommandTemplateToPrintMimeType:mimeType |
|
1097 |
|cmd| |
|
1098 |
||
1099 |
cmd := self defaultPrintCommandPerMIME at:mimeType ifAbsent:nil. |
|
1100 |
cmd isNil ifTrue:[ |
|
1101 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
1102 |
cmd := Win32OperatingSystem::RegistryEntry commandTemplateToPrintMimeType:mimeType |
|
1103 |
]. |
|
1104 |
]. |
|
1105 |
^ cmd |
|
1106 |
||
1107 |
" |
|
1108 |
MIMETypes defaultCommandTemplateToPrintMimeType:'application/pdf' |
|
1109 |
" |
|
2117 | 1110 |
! |
1111 |
||
1112 |
defaultPrintCommandPerMIME |
|
1113 |
"returns the collection which is used to map MIME-type to printing command-templates." |
|
1114 |
||
1115 |
"TODO: move this to OS/UserPreferences" |
|
1116 |
||
1117 |
DefaultPrintCommandPerMIMEPerOS isNil ifTrue:[ |
|
1118 |
self initializeDefaultCommands |
|
1119 |
]. |
|
1120 |
OperatingSystem isUNIXlike ifTrue:[ |
|
1121 |
^ DefaultPrintCommandPerMIMEPerOS at:#unix |
|
1122 |
]. |
|
1123 |
^ DefaultPrintCommandPerMIMEPerOS at:#win32 |
|
2116 | 1124 |
! ! |
1125 |
||
1729 | 1126 |
!MIMETypes class methodsFor:'queries-image formats'! |
1127 |
||
1128 |
imageReaderClasses |
|
1129 |
"return a collection of registered image reader classes" |
|
1130 |
||
1131 |
|setOfClasses| |
|
1132 |
||
1133 |
setOfClasses := IdentitySet new. |
|
1134 |
FileSuffixToImageReaderClassMapping notNil ifTrue:[ |
|
1135 |
FileSuffixToImageReaderClassMapping keysAndValuesDo:[:suff :cls | |
|
1136 |
setOfClasses add:cls |
|
1137 |
]. |
|
1138 |
]. |
|
1139 |
TypeToImageReaderClassMapping notNil ifTrue:[ |
|
1140 |
TypeToImageReaderClassMapping keysAndValuesDo:[:suff :cls | |
|
1141 |
setOfClasses add:cls |
|
1142 |
]. |
|
1143 |
]. |
|
1144 |
^ setOfClasses |
|
1145 |
||
1146 |
"Created: / 30.6.1997 / 22:03:42 / cg" |
|
1147 |
"Modified: / 1.8.1998 / 16:59:52 / cg" |
|
1148 |
! |
|
1149 |
||
1150 |
imageReaderForSuffix:aSuffix |
|
1151 |
"given a file suffix, return an approriate image reader class" |
|
1152 |
||
2724
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1153 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[ |
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1154 |
self initializeImageReaderMappings |
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1155 |
]. |
1729 | 1156 |
^ FileSuffixToImageReaderClassMapping at:aSuffix asLowercase ifAbsent:nil |
1157 |
||
1158 |
"Created: / 30.6.1997 / 21:59:11 / cg" |
|
1159 |
"Modified: / 1.8.1998 / 17:01:58 / cg" |
|
1160 |
! |
|
1161 |
||
1162 |
imageReaderForSuffix:aSuffix put:aReaderClass |
|
1163 |
"register an image reader for a file suffix" |
|
1164 |
||
1165 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[ |
|
2724
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1166 |
self initializeImageReaderMappings |
1729 | 1167 |
]. |
1168 |
FileSuffixToImageReaderClassMapping at:aSuffix asLowercase put:aReaderClass |
|
1169 |
||
1170 |
"Created: / 30.6.1997 / 21:59:43 / cg" |
|
1171 |
"Modified: / 1.8.1998 / 17:02:14 / cg" |
|
1172 |
! |
|
1173 |
||
1174 |
imageReaderForType:mimeTypeString |
|
1175 |
"given a mime-type, return an approriate image reader class" |
|
1176 |
||
2724
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1177 |
TypeToImageReaderClassMapping isNil ifTrue:[ |
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1178 |
self initializeImageReaderMappings |
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1179 |
]. |
1729 | 1180 |
^ TypeToImageReaderClassMapping at:mimeTypeString asLowercase ifAbsent:nil |
1181 |
||
1182 |
"Created: / 30.6.1997 / 21:56:01 / cg" |
|
1183 |
"Modified: / 1.8.1998 / 17:02:28 / cg" |
|
1184 |
! |
|
1185 |
||
1186 |
imageReaderForType:mimeTypeString put:aReaderClass |
|
1187 |
"register an image reader for a mime-type" |
|
1188 |
||
1189 |
TypeToImageReaderClassMapping isNil ifTrue:[ |
|
2724
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1190 |
self initializeImageReaderMappings |
1729 | 1191 |
]. |
1192 |
TypeToImageReaderClassMapping at:mimeTypeString asLowercase put:aReaderClass |
|
1193 |
||
1194 |
"Created: / 30.6.1997 / 21:56:11 / cg" |
|
1195 |
"Modified: / 1.8.1998 / 17:02:40 / cg" |
|
1196 |
! ! |
|
1197 |
||
1198 |
!MIMETypes class methodsFor:'queries-language syntax'! |
|
1199 |
||
1200 |
commentStringsForFilename:aFilename |
|
1201 |
"return a useful comment definition; heuristics for now. |
|
1202 |
The returned value is an array of 2 elements; |
|
1203 |
the first is the end-of-line comment string (or nil); |
|
1204 |
the second an array of opening/closing delimiters (or an array of nils)" |
|
1205 |
||
1206 |
|mime| |
|
1207 |
||
1208 |
mime := MIMETypes mimeTypeForFilename:aFilename. |
|
1209 |
^ self commentStringsForMimeType:mime suffix:(aFilename asFilename suffix) |
|
1210 |
||
1211 |
" |
|
1212 |
MIMETypes commentStringsForFilename:'Makefile'. |
|
1213 |
MIMETypes commentStringsForFilename:'Object.st'. |
|
1214 |
MIMETypes commentStringsForFilename:'Foo.java'. |
|
1925 | 1215 |
MIMETypes commentStringsForFilename:'Foo.html'. |
1729 | 1216 |
" |
1217 |
! |
|
1218 |
||
1219 |
commentStringsForFilename:aFilename ifUnknown:alternativeBlockReturningCommentString |
|
1220 |
"return a useful comment definition; heuristics for now. |
|
1221 |
The returned value is an array of 2 elements; |
|
1222 |
the first is the end-of-line comment string (or nil); |
|
1223 |
the second an array of opening/closing delimiters (or an array of nils)" |
|
1224 |
||
1225 |
|mime| |
|
1226 |
||
1227 |
mime := MIMETypes mimeTypeForFilename:aFilename. |
|
1228 |
^ self commentStringsForMimeType:mime suffix:(aFilename asFilename suffix) ifUnknown:alternativeBlockReturningCommentString |
|
1229 |
||
1230 |
" |
|
1231 |
MIMETypes commentStringsForFilename:'Makefile'. |
|
1232 |
MIMETypes commentStringsForFilename:'Object.st'. |
|
1233 |
MIMETypes commentStringsForFilename:'Foo.java'. |
|
1234 |
" |
|
1235 |
! |
|
1236 |
||
1237 |
commentStringsForMimeType:mime suffix:suff |
|
1238 |
"return a useful comment definition; heuristics for now. |
|
1239 |
The returned value is an array of 2 elements; |
|
1240 |
the first is the end-of-line comment string (or nil); |
|
1241 |
the second an array of opening/closing delimiters (or an array of nils)" |
|
1242 |
||
1243 |
^ self |
|
1244 |
commentStringsForMimeType:mime suffix:suff |
|
1245 |
ifUnknown: #(';' (nil nil)) |
|
1246 |
||
1247 |
" |
|
1248 |
|mime| |
|
1249 |
||
1250 |
mime := MIMETypes mimeTypeForFilename:'Makefile'. |
|
1251 |
MIMETypes commentStringsForMimeType:mime suffix:nil. |
|
1252 |
" |
|
1253 |
||
1254 |
" |
|
1255 |
|mime| |
|
1256 |
||
1257 |
mime := MIMETypes mimeTypeForFilename:'Object.st'. |
|
1258 |
MIMETypes commentStringsForMimeType:mime suffix:nil. |
|
1259 |
" |
|
1260 |
! |
|
1261 |
||
1262 |
commentStringsForMimeType:mime suffix:suff ifUnknown:alternativeBlockReturningCommentString |
|
1263 |
"return a useful comment definition; heuristics for now. |
|
1264 |
The returned value is an array of 2 elements; |
|
1265 |
the first is the end-of-line comment string (or nil); |
|
1266 |
the second an array of opening/closing delimiters (or an array of nils)" |
|
1267 |
||
1268 |
|commentSpec| |
|
1269 |
||
1270 |
commentSpec := TypeToCommentStringMapping at:mime ifAbsent:nil. |
|
1271 |
commentSpec notNil ifTrue:[ |
|
1272 |
^ commentSpec |
|
1273 |
]. |
|
1274 |
||
1275 |
commentSpec := SuffixToCommentStringMapping at:suff ifAbsent:nil. |
|
1276 |
commentSpec notNil ifTrue:[ |
|
1277 |
^ commentSpec |
|
1278 |
]. |
|
1279 |
||
1280 |
^ alternativeBlockReturningCommentString value |
|
1281 |
||
1282 |
" |
|
1283 |
|mime| |
|
1284 |
||
1285 |
mime := MIMETypes mimeTypeForFilename:'Makefile'. |
|
1286 |
MIMETypes commentStringsForMimeType:mime suffix:nil. |
|
1287 |
" |
|
1288 |
||
1289 |
" |
|
1290 |
|mime| |
|
1291 |
||
1292 |
mime := MIMETypes mimeTypeForFilename:'Object.st'. |
|
1293 |
MIMETypes commentStringsForMimeType:mime suffix:nil. |
|
1294 |
" |
|
2298 | 1295 |
! |
1296 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1297 |
parenthesisSpecForFilename:aFilename |
2298 | 1298 |
"return a useful parentesis spec; heuristics for now. |
1299 |
The returned value is a dictionary to be used as parentesis spec in an editor" |
|
1300 |
||
1301 |
|mime| |
|
1302 |
||
1303 |
mime := MIMETypes mimeTypeForFilename:aFilename. |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1304 |
^ self parenthesisSpecForMimeType:mime suffix:(aFilename asFilename suffix) |
2298 | 1305 |
|
1306 |
" |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1307 |
MIMETypes parenthesisSpecForFilename:'Object.st'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1308 |
MIMETypes parenthesisSpecForFilename:'Foo.java'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1309 |
MIMETypes parenthesisSpecForFilename:'Foo.html'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1310 |
MIMETypes parenthesisSpecForFilename:'Foo.lsp'. |
2298 | 1311 |
" |
1312 |
||
1313 |
"Created: / 10-04-2007 / 15:18:41 / cg" |
|
1314 |
! |
|
1315 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1316 |
parenthesisSpecForFilename:aFilename ifUnknown:alternative |
2298 | 1317 |
|mime| |
1318 |
||
1319 |
mime := MIMETypes mimeTypeForFilename:aFilename. |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1320 |
^ self parenthesisSpecForMimeType:mime suffix:(aFilename asFilename suffix) ifUnknown:alternative |
2298 | 1321 |
|
1322 |
"Created: / 10-04-2007 / 15:26:20 / cg" |
|
1323 |
! |
|
1324 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1325 |
parenthesisSpecForMimeType:mime suffix:suff |
2298 | 1326 |
^ self |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1327 |
parenthesisSpecForMimeType:mime suffix:suff |
2298 | 1328 |
ifUnknown: nil |
1329 |
||
1330 |
"Created: / 10-04-2007 / 15:19:39 / cg" |
|
1331 |
! |
|
1332 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1333 |
parenthesisSpecForMimeType:mime suffix:suff ifUnknown:alternativeValue |
2298 | 1334 |
|spec| |
1335 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1336 |
spec := TypeToParenthesisSpecMapping at:mime ifAbsent:nil. |
2298 | 1337 |
spec notNil ifTrue:[ |
1338 |
^ spec |
|
1339 |
]. |
|
1340 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1341 |
spec := SuffixToParenthesisSpecMapping at:suff ifAbsent:nil. |
2298 | 1342 |
spec notNil ifTrue:[ |
1343 |
^ spec |
|
1344 |
]. |
|
1345 |
||
1346 |
^ alternativeValue value |
|
1347 |
||
1348 |
"Created: / 10-04-2007 / 15:20:38 / cg" |
|
1729 | 1349 |
! ! |
1350 |
||
1612 | 1351 |
!MIMETypes::MIMEType class methodsFor:'documentation'! |
1352 |
||
1353 |
documentation |
|
1354 |
" |
|
1864 | 1355 |
like a string, but knows that it represents a mimeType. |
1612 | 1356 |
" |
1357 |
! ! |
|
1358 |
||
1359 |
!MIMETypes::MIMEType class methodsFor:'instance creation'! |
|
1360 |
||
1361 |
fromString:aString |
|
1362 |
|cachedType newType| |
|
1363 |
||
1364 |
aString class == self ifTrue:[^ aString]. |
|
1365 |
||
3011
f2af94d78383
delay initialization of cachedTypes
Claus Gittinger <cg@exept.de>
parents:
3008
diff
changeset
|
1366 |
CachedTypes isNil ifTrue:[ |
3012 | 1367 |
CachedTypes := Dictionary new:100. |
3011
f2af94d78383
delay initialization of cachedTypes
Claus Gittinger <cg@exept.de>
parents:
3008
diff
changeset
|
1368 |
]. |
1612 | 1369 |
cachedType := CachedTypes at:aString ifAbsent:nil. |
1370 |
cachedType notNil ifTrue:[^ cachedType]. |
|
3011
f2af94d78383
delay initialization of cachedTypes
Claus Gittinger <cg@exept.de>
parents:
3008
diff
changeset
|
1371 |
|
1612 | 1372 |
newType := aString copy changeClassTo:self. |
1373 |
CachedTypes at:aString put:newType. |
|
1374 |
^ newType |
|
1375 |
||
1376 |
" |
|
1377 |
self fromString:'text/html' |
|
1378 |
" |
|
3011
f2af94d78383
delay initialization of cachedTypes
Claus Gittinger <cg@exept.de>
parents:
3008
diff
changeset
|
1379 |
|
3012 | 1380 |
"Modified: / 20-07-2012 / 17:36:31 / cg" |
1612 | 1381 |
! ! |
1382 |
||
1383 |
!MIMETypes::MIMEType methodsFor:'queries'! |
|
1384 |
||
1693 | 1385 |
isArchive |
3260 | 1386 |
<resource: #obsolete> |
1387 |
"return true, if I represent an archive type (such as zip or tar)" |
|
1388 |
||
1389 |
^ self isArchiveType |
|
1390 |
! |
|
1391 |
||
1392 |
isArchiveType |
|
1864 | 1393 |
"return true, if I represent an archive type (such as zip or tar)" |
1394 |
||
1612 | 1395 |
|archivTypes| |
1396 |
||
1729 | 1397 |
archivTypes := MIMETypes applicationCompressorsAndArchiveTypeList. |
1612 | 1398 |
archivTypes pairWiseDo:[: ext : type | |
1399 |
self = type ifTrue:[ ^ true]. |
|
1400 |
]. |
|
1401 |
^ false |
|
1402 |
! |
|
1403 |
||
2024 | 1404 |
isBinary |
3260 | 1405 |
<resource: #obsolete> |
1406 |
"return true, if I represent a binary (non-text) type" |
|
1407 |
||
1408 |
^ self isBinaryType |
|
1409 |
! |
|
1410 |
||
1411 |
isBinaryType |
|
2024 | 1412 |
"return true, if I represent a binary (non-text) type" |
1413 |
||
1414 |
^ self isTextType not |
|
1415 |
! |
|
1416 |
||
1612 | 1417 |
isHtml |
3260 | 1418 |
<resource: #obsolete> |
1419 |
"return true, if I represent the html text type" |
|
1420 |
||
1421 |
^ self isHtmlType |
|
1422 |
! |
|
1423 |
||
1424 |
isHtmlType |
|
1864 | 1425 |
"return true, if I represent the html text type" |
1612 | 1426 |
|
1427 |
^ (self = 'text/html') |
|
1428 |
! |
|
1429 |
||
1430 |
isImage |
|
3260 | 1431 |
<resource: #obsolete> |
1432 |
"return true, if I represent an image type (such as gif or jpg)" |
|
1433 |
||
1434 |
^ self isImageType |
|
1435 |
! |
|
1436 |
||
1437 |
isImageType |
|
1864 | 1438 |
"return true, if I represent an image type (such as gif or jpg)" |
1612 | 1439 |
|
1693 | 1440 |
^ (self startsWith:'image/') |
1612 | 1441 |
! |
1442 |
||
1443 |
isPdf |
|
3260 | 1444 |
<resource: #obsolete> |
1445 |
"return true, if I represent the pdf type" |
|
1446 |
||
1447 |
^ self isPdfType |
|
1448 |
! |
|
1449 |
||
1450 |
isPdfType |
|
1864 | 1451 |
"return true, if I represent the pdf type" |
1452 |
||
1612 | 1453 |
^ (self = 'application/pdf') |
1454 |
! |
|
1455 |
||
1456 |
isSmalltalkSource |
|
3260 | 1457 |
<resource: #obsolete> |
1458 |
"return true, if I represent the smalltalk sourcecode type" |
|
1459 |
||
1460 |
^ self isSmalltalkSourceType |
|
1461 |
! |
|
1462 |
||
1463 |
isSmalltalkSourceType |
|
1864 | 1464 |
"return true, if I represent the smalltalk sourcecode type" |
1465 |
||
1612 | 1466 |
^ (self = 'application/x-smalltalk-source') |
1783 | 1467 |
! |
1468 |
||
2024 | 1469 |
isTextType |
1470 |
"return true, if I represent some text type" |
|
1471 |
||
1472 |
^ self startsWith:'text/' |
|
1473 |
! |
|
1474 |
||
1783 | 1475 |
isXml |
3260 | 1476 |
<resource: #obsolete> |
1477 |
"return true, if I represent the xml text type" |
|
1478 |
||
1479 |
^ self isXmlType |
|
1480 |
! |
|
1481 |
||
1482 |
isXmlType |
|
1864 | 1483 |
"return true, if I represent the xml text type" |
1484 |
||
1783 | 1485 |
^ (self = 'text/xml') |
2490 | 1486 |
! |
1487 |
||
1488 |
suffix |
|
1489 |
^ MIMETypes suffixForMimeType:self |
|
1490 |
||
1491 |
" |
|
1492 |
(MIMETypes mimeTypeFromString:'application/x-expecco-testsuite') suffix |
|
1493 |
" |
|
643 | 1494 |
! ! |
1495 |
||
1496 |
!MIMETypes class methodsFor:'documentation'! |
|
1497 |
||
1498 |
version |
|
3322 | 1499 |
^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.133 2014-03-31 09:19:26 cg Exp $' |
2758
66e62ceecb67
comment/format in: #defaultCommandForMimeType:
Claus Gittinger <cg@exept.de>
parents:
2724
diff
changeset
|
1500 |
! |
66e62ceecb67
comment/format in: #defaultCommandForMimeType:
Claus Gittinger <cg@exept.de>
parents:
2724
diff
changeset
|
1501 |
|
66e62ceecb67
comment/format in: #defaultCommandForMimeType:
Claus Gittinger <cg@exept.de>
parents:
2724
diff
changeset
|
1502 |
version_CVS |
3322 | 1503 |
^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.133 2014-03-31 09:19:26 cg Exp $' |
643 | 1504 |
! ! |
1666 | 1505 |
|
3104 | 1506 |
|
643 | 1507 |
MIMETypes initialize! |