author | Claus Gittinger <cg@exept.de> |
Tue, 03 Jun 2003 20:07:57 +0200 | |
changeset 1783 | faf721f692ae |
parent 1780 | ba94d562efe8 |
child 1800 | 817b8ce39da7 |
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 |
||
12 |
||
13 |
" |
|
14 |
||
1410 | 15 |
"{ Package: 'stx:libview2' }" |
16 |
||
643 | 17 |
Object subclass:#MIMETypes |
1612 | 18 |
instanceVariableNames:'' |
1729 | 19 |
classVariableNames:'TypeToImageReaderClassMapping TypeToCommentStringMapping |
20 |
SuffixToCommentStringMapping FileSuffixToTypeMapping |
|
1612 | 21 |
FilenameToTypeMapping FileSuffixToImageReaderClassMapping |
1691
6ee1100ba672
defaultCommandPerMIME moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
22 |
CharSetToFontMapping LastSuffix LastType |
6ee1100ba672
defaultCommandPerMIME moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
23 |
DefaultCommandPerMIMEPerOS' |
1612 | 24 |
poolDictionaries:'' |
1716 | 25 |
category:'System-Communication-Support' |
1612 | 26 |
! |
27 |
||
28 |
String variableByteSubclass:#MIMEType |
|
29 |
instanceVariableNames:'' |
|
30 |
classVariableNames:'CachedTypes' |
|
31 |
poolDictionaries:'' |
|
32 |
privateIn:MIMETypes |
|
643 | 33 |
! |
34 |
||
35 |
!MIMETypes class methodsFor:'documentation'! |
|
36 |
||
37 |
copyright |
|
38 |
" |
|
39 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
1612 | 40 |
All Rights Reserved |
643 | 41 |
|
42 |
This software is furnished under a license and may be used |
|
43 |
only in accordance with the terms of that license and with the |
|
44 |
inclusion of the above copyright notice. This software may not |
|
45 |
be provided or otherwise made available to, or used by, any |
|
46 |
other person. No title to or ownership of the software is |
|
47 |
hereby transferred. |
|
48 |
||
49 |
||
50 |
" |
|
51 |
! |
|
52 |
||
53 |
documentation |
|
54 |
" |
|
55 |
just a place to keep MIME information |
|
56 |
(avoid spreading things at many places) |
|
57 |
||
1021 | 58 |
MIMETypes is abstract and functional. |
59 |
Actually, in some OperatingSystems, this information may |
|
60 |
be found in some config files (or registries). |
|
61 |
Therefore, this class may have to be extended to support this |
|
62 |
and fetch the information from there eventually. |
|
63 |
||
643 | 64 |
[author:] |
65 |
Claus Gittinger |
|
66 |
" |
|
1311 | 67 |
! |
68 |
||
69 |
knownTypes |
|
70 |
" |
|
71 |
simply a reminder for me ... |
|
72 |
||
73 |
application mime file extentsions |
|
74 |
||
75 |
powerpoint application/ms-powerpoint .pot, .ppz, .ppt, .pps, |
|
76 |
application/mspowerpoint |
|
77 |
application/vnd.ms-powerpoint |
|
78 |
application/x-mspowerpoint |
|
79 |
||
1312 | 80 |
shockwave application/x-shockwave-flash .swf |
1311 | 81 |
|
1312 | 82 |
futuresplash application/futuresplash .spl |
1311 | 83 |
" |
643 | 84 |
! ! |
85 |
||
86 |
!MIMETypes class methodsFor:'initialization'! |
|
87 |
||
1729 | 88 |
initialize |
89 |
"initialize wellKnown facts" |
|
90 |
||
91 |
MIMEType initialize. "must be initialized first" |
|
92 |
LastSuffix := LastType := nil. |
|
93 |
||
94 |
self initializeFileNameToMimeTypeMapping. |
|
95 |
self initializeImageReaderMappings. |
|
96 |
self initializeCommentStringMappings. |
|
97 |
||
98 |
" |
|
99 |
self initialize |
|
100 |
" |
|
101 |
||
102 |
"Modified: / 19.11.1999 / 15:01:53 / cg" |
|
103 |
! |
|
104 |
||
105 |
initializeCommentStringMappings |
|
106 |
TypeToCommentStringMapping := Dictionary new. |
|
107 |
SuffixToCommentStringMapping := Dictionary new. |
|
108 |
||
109 |
TypeToCommentStringMapping |
|
110 |
at:'application/x-make' |
|
111 |
put:#('#' (nil nil)). "/ '#' for EOL comments only |
|
112 |
||
113 |
TypeToCommentStringMapping |
|
114 |
at:'application/x-sh' |
|
115 |
put:#('#' (nil nil)). "/ '#' for EOL comments only |
|
116 |
||
117 |
#('text/html' 'text/xml' 'application/xml') |
|
118 |
do:[:eachXMLType | |
|
119 |
TypeToCommentStringMapping |
|
120 |
at:eachXMLType |
|
121 |
put:#(nil ('<!!-- ' ' -->')). "/ '<!!-- ... -->' delimited comments only |
|
122 |
]. |
|
123 |
||
124 |
TypeToCommentStringMapping |
|
125 |
at:'application/x-batch-script' |
|
126 |
put:#('rem ' (nil nil)). "/ 'rem ' for EOL comments only |
|
127 |
||
128 |
"/ the following is ST/X specific |
|
129 |
TypeToCommentStringMapping |
|
130 |
at:'application/x-smalltalk-source' |
|
131 |
put:#('"/' ('"' '"')). "/ '"/ ' for EOL; ".." for delimited comments |
|
132 |
||
133 |
"/ this is for standard smalltalk |
|
134 |
"/ TypeToCommentStringMapping |
|
135 |
"/ at:'application/x-smalltalk-source' |
|
136 |
"/ put:#(nil ('"' '"')). "/ ".." for delimited comments only |
|
137 |
||
138 |
||
139 |
TypeToCommentStringMapping |
|
140 |
at:'application/x-pascal-source' |
|
141 |
put:#(nil ('{' '}')). "/ '{'..'}' for delimited comments |
|
142 |
||
143 |
"/ the following is k&r |
|
144 |
TypeToCommentStringMapping |
|
145 |
at:'application/x-c-source' |
|
146 |
put:#(nil ('/*' '*/')). "/ '/*'..'*/' for delimited comments |
|
147 |
||
148 |
"/ this is ANSI-c |
|
149 |
TypeToCommentStringMapping |
|
150 |
at:'application/x-c-source' |
|
151 |
put:#('//' ('/*' '*/')). |
|
152 |
||
153 |
TypeToCommentStringMapping |
|
154 |
at:'application/x-cpp-source' |
|
155 |
put:#('//' ('/*' '*/')). |
|
156 |
||
157 |
TypeToCommentStringMapping |
|
158 |
at:'application/x-java-source' |
|
159 |
put:#('//' ('/*' '*/')). |
|
160 |
||
161 |
TypeToCommentStringMapping |
|
162 |
at:'application/x-asn1-source' |
|
163 |
put:#('--' ('--' '--')). |
|
164 |
||
165 |
||
166 |
"/ st/x support files |
|
167 |
SuffixToCommentStringMapping |
|
168 |
at:'style' |
|
169 |
put:#(';' (nil nil)). |
|
1604 | 170 |
|
1729 | 171 |
SuffixToCommentStringMapping |
172 |
at:'rs' |
|
173 |
put:#(';' (nil nil)). |
|
174 |
! |
|
175 |
||
176 |
initializeDefaultCommands |
|
177 |
"TODO: move this to OS" |
|
178 |
||
179 |
|unixCommands win32Commands| |
|
180 |
||
181 |
DefaultCommandPerMIMEPerOS := Dictionary new. |
|
182 |
DefaultCommandPerMIMEPerOS at:#unix put:(unixCommands := Dictionary new). |
|
183 |
DefaultCommandPerMIMEPerOS at:#win32 put:(win32Commands := Dictionary new). |
|
184 |
||
185 |
unixCommands at:'application/x-tar-compressed' put:'gunzip < %1 | tar tvf -'. |
|
186 |
unixCommands at:'application/pdf' put:'acroread -display %2 %1'. |
|
187 |
||
188 |
" |
|
189 |
self initializeDefaultCommands |
|
190 |
" |
|
191 |
! |
|
192 |
||
193 |
initializeFileNameToMimeTypeMapping |
|
194 |
"initialize wellKnown facts" |
|
195 |
||
196 |
|types| |
|
197 |
||
198 |
FileSuffixToTypeMapping isNil ifTrue:[ |
|
199 |
FileSuffixToTypeMapping := Dictionary new |
|
200 |
]. |
|
201 |
FilenameToTypeMapping isNil ifTrue:[ |
|
202 |
FilenameToTypeMapping := Dictionary new. |
|
203 |
]. |
|
204 |
||
205 |
types := OrderedCollection new. |
|
206 |
types addAll:self textTypeList. |
|
207 |
types addAll:self imageTypeList. |
|
208 |
types addAll:self videoTypeList. |
|
209 |
types addAll:self audioTypeList. |
|
210 |
types addAll:self applicationTypeList. |
|
211 |
types pairWiseDo:[:suff :typeString| |
|
212 |
|type| |
|
213 |
||
214 |
type := MIMEType fromString:typeString. |
|
215 |
suff isArray ifTrue:[ |
|
216 |
suff do:[:s | FileSuffixToTypeMapping at:s put:type] |
|
217 |
] ifFalse:[ |
|
218 |
FileSuffixToTypeMapping at:suff put:type |
|
219 |
] |
|
220 |
]. |
|
221 |
||
222 |
self miscFilenameList pairWiseDo:[:nm :typeString| |
|
223 |
|type| |
|
224 |
||
225 |
type := MIMEType fromString:typeString. |
|
226 |
nm isArray ifTrue:[ |
|
227 |
nm do:[:s | FilenameToTypeMapping at:s put:type] |
|
228 |
] ifFalse:[ |
|
229 |
FilenameToTypeMapping at:nm put:type |
|
230 |
] |
|
231 |
]. |
|
232 |
! |
|
233 |
||
234 |
initializeImageReaderMappings |
|
235 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[ |
|
236 |
FileSuffixToImageReaderClassMapping := Dictionary new |
|
237 |
]. |
|
238 |
"MIME" TypeToImageReaderClassMapping isNil ifTrue:[ |
|
239 |
TypeToImageReaderClassMapping := Dictionary new |
|
240 |
]. |
|
241 |
||
242 |
"/ setup mimeType to image reader class mapping ... |
|
243 |
||
244 |
TypeToImageReaderClassMapping at:'image/jpeg' put:JPEGReader. |
|
245 |
TypeToImageReaderClassMapping at:'image/gif' put:GIFReader. |
|
246 |
TypeToImageReaderClassMapping at:'image/tiff' put:TIFFReader. |
|
247 |
||
248 |
"/ setup suffix to image reader class mapping ... |
|
249 |
||
250 |
FileSuffixToImageReaderClassMapping at:'jpg' put:JPEGReader. |
|
251 |
FileSuffixToImageReaderClassMapping at:'gif' put:GIFReader. |
|
252 |
FileSuffixToImageReaderClassMapping at:'tif' put:TIFFReader. |
|
253 |
! ! |
|
254 |
||
255 |
!MIMETypes class methodsFor:'initialization-lists'! |
|
256 |
||
257 |
applicationCompressorsAndArchiveTypeList |
|
1604 | 258 |
^ #( |
259 |
'tar' 'application/x-tar' |
|
260 |
'gtar' 'application/x-gtar' |
|
1780
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
261 |
('tgz' 'tar.gz') 'application/x-tar-compressed' |
1604 | 262 |
'zip' 'application/x-zip-compressed' |
1778 | 263 |
"/ 'zip' 'application/zip' ??? |
1604 | 264 |
('gz' 'z') 'application/x-gzip-compressed' |
265 |
'cpio' 'application/x-cpio' |
|
266 |
'shar' 'application/x-shar' |
|
267 |
'jar' 'application/java-archive' |
|
1775 | 268 |
'sar' 'application/x-squeak-archive' |
1778 | 269 |
'sit' 'application/x-stuffit' |
270 |
'hqx' 'application/mac-binhex40' |
|
271 |
'cpt' 'application/mac-compactpro' |
|
1604 | 272 |
) |
273 |
! |
|
645 | 274 |
|
1609 | 275 |
applicationMiscTypeList |
276 |
"misc applications" |
|
277 |
||
278 |
^ #( |
|
279 |
('a' 'o' 'obj' ) 'application/binary' |
|
280 |
'a' 'application/library' |
|
281 |
('dll' 'so') 'application/shared-library' |
|
282 |
) |
|
283 |
! |
|
284 |
||
1604 | 285 |
applicationProgLangTypeList |
1606 | 286 |
"applications for programm languages" |
713 | 287 |
|
1604 | 288 |
^ #( |
1609 | 289 |
('st' 'cls' 'rc') 'application/x-smalltalk-source' |
1604 | 290 |
'sif' 'application/x-smalltalk-source-sif' |
1668 | 291 |
'pac' 'application/x-smalltalk-dolphin-package' |
1778 | 292 |
|
293 |
'sts' 'application/x-squeak-source' |
|
294 |
'pr' 'application/x-squeak-project' |
|
295 |
||
1604 | 296 |
'c' 'application/x-c-source' |
297 |
('cc' 'cpp') 'application/x-cpp-source' |
|
1609 | 298 |
('h' 'hi') 'application/x-c-header' |
1604 | 299 |
('js' 'mocha') 'application/x-javascript' |
300 |
('java' 'jav') 'application/x-java-source' |
|
301 |
'sh' 'application/x-sh' |
|
302 |
'csh' 'application/x-csh' |
|
303 |
'tcl' 'application/x-tcl' |
|
304 |
'pl' 'application/x-perl' |
|
305 |
'mak' 'application/x-make' |
|
306 |
'bat' 'application/x-batch-script' |
|
307 |
('asn1' 'x409' 'gdmo' 'gdm') 'application/x-asn1-source' |
|
308 |
) |
|
309 |
! |
|
1561 | 310 |
|
1604 | 311 |
applicationTextTypeList |
1606 | 312 |
"text applications" |
1604 | 313 |
|
314 |
^ #( |
|
315 |
('ps' 'eps') 'application/postscript' |
|
1778 | 316 |
"/ 'ai' 'application/postscript' |
1604 | 317 |
'pdf' 'application/pdf' |
318 |
'rtf' 'application/rtf' |
|
1778 | 319 |
"/ 'rtf' 'text/rtf' ???? |
320 |
"/ 'doc' 'application/winword' |
|
1779 | 321 |
'doc' 'application/ms-word-document' |
1778 | 322 |
'swf' 'application/x-shockwave-flash' |
323 |
('ppt' 'ppz' 'pot' 'pps') 'application/mspowerpoint' |
|
324 |
'xls' 'application/x-excel' |
|
1604 | 325 |
) |
326 |
! |
|
327 |
||
328 |
applicationTypeList |
|
1606 | 329 |
"applications" |
1604 | 330 |
|
1729 | 331 |
|typeList| |
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
332 |
|
1729 | 333 |
typeList := OrderedCollection new. |
334 |
typeList addAll:self applicationProgLangTypeList. |
|
335 |
typeList addAll:self applicationTextTypeList. |
|
336 |
typeList addAll:self applicationCompressorsAndArchiveTypeList. |
|
337 |
typeList addAll:self applicationMiscTypeList. |
|
1616 | 338 |
|
1729 | 339 |
^ typeList |
1604 | 340 |
! |
341 |
||
342 |
audioTypeList |
|
1606 | 343 |
"audio formats ..." |
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
344 |
|
1604 | 345 |
^ #( |
1720 | 346 |
('au' 'snd') 'audio/basic' |
1778 | 347 |
('ra') 'audio/x-realaudio' |
348 |
('ram' 'rm') 'audio/x-pn-realaudio' |
|
1680 | 349 |
'rpm' 'audio/x-pn-realaudio-plugin' |
1720 | 350 |
('mpa' 'mpega') 'audio/mpeg' |
1778 | 351 |
"/ 'mp3' 'audio/x-mp3' |
352 |
('mp3' 'mp2') 'audio/mpeg' |
|
1604 | 353 |
'wav' 'audio/x-wav' |
354 |
('aif' 'aiff' 'aifc') 'audio/x-aiff' |
|
1778 | 355 |
('midi' 'mid') 'audio/midi' |
1604 | 356 |
) |
357 |
! |
|
358 |
||
359 |
imageTypeList |
|
360 |
||
361 |
^ #( |
|
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
362 |
"/ image formats ... |
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
363 |
|
1216 | 364 |
('jpg' 'jpeg') 'image/jpeg' |
1188 | 365 |
'gif' 'image/gif' |
366 |
('tif' 'tiff') 'image/tiff' |
|
367 |
'xbm' 'image/x-xbitmap' |
|
368 |
'xpm' 'image/x-xpixmap' |
|
1720 | 369 |
'png' 'image/png' |
1188 | 370 |
'pcd' 'image/x-photo-cd' |
371 |
'bmp' 'image/x-MS-bmp' |
|
372 |
'rgb' 'image/x-rgb' |
|
373 |
'ppm' 'image/x-portable-pixmap' |
|
374 |
'pgm' 'image/x-portable-graymap' |
|
375 |
'pbm' 'image/x-portable-bitmap' |
|
376 |
'pnm' 'image/x-portable-anymap' |
|
377 |
'xwd' 'image/x-xwindowdump' |
|
378 |
'ras' 'image/x-cmu-raster' |
|
1216 | 379 |
'tga' 'image/x-targa' |
1604 | 380 |
) |
381 |
! |
|
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
382 |
|
1609 | 383 |
miscFilenameList |
384 |
"other formats (not by suffix, but by fileName isnstead) ..." |
|
385 |
||
386 |
^ #( |
|
387 |
('makefile' 'make.proto') 'application/x-make' |
|
1778 | 388 |
('exe' 'bin') 'application/octet-stream' |
389 |
('class') 'application/octet-stream' |
|
1609 | 390 |
) |
391 |
! |
|
392 |
||
1604 | 393 |
textTypeList |
394 |
"/ misc text ... |
|
395 |
||
396 |
^ #( |
|
397 |
('htm' 'html') 'text/html' |
|
1680 | 398 |
'shtml' 'text/html' |
1604 | 399 |
('txt' 'text') 'text/plain' |
1680 | 400 |
'xml' 'text/xml' |
1777 | 401 |
'css' 'text/css' |
1604 | 402 |
) |
403 |
! |
|
404 |
||
405 |
videoTypeList |
|
406 |
"/ video formats ... |
|
407 |
||
408 |
^ #( |
|
1720 | 409 |
('qt' 'mov' 'moov') 'video/quicktime' |
410 |
('mpv' 'mpegv' 'mpg' 'mpeg' 'mpe') 'video/mpeg' |
|
1604 | 411 |
'movie' 'video/x-sgi-movie' |
412 |
'avi' 'video/x-msvideo' |
|
413 |
('mpv2' 'mp2v' 'mp2' 'mpeg2') 'video/x-mpeg2' |
|
1680 | 414 |
'rm' 'application/vnd.rn-realmedia' |
415 |
'rv' 'video/x-pn-realvideo' |
|
1778 | 416 |
) |
643 | 417 |
! ! |
418 |
||
1729 | 419 |
!MIMETypes class methodsFor:'obsolete'! |
1489 | 420 |
|
1729 | 421 |
fontForCharset:aCharSetName |
422 |
"return the font-encoding for an iso-charset" |
|
1489 | 423 |
|
1729 | 424 |
self obsoleteMethodWarning:'use FontDescription >> fontNamePatternForCharset:'. |
425 |
^ FontDescription fontNamePatternForCharset:aCharSetName. |
|
1489 | 426 |
|
427 |
" |
|
1729 | 428 |
MIMETypes fontForCharset:'iso2022-jp' |
429 |
MIMETypes fontForCharset:'euc-jp' |
|
1472 | 430 |
" |
431 |
||
1729 | 432 |
"Modified: / 1.8.1998 / 17:00:57 / cg" |
433 |
! ! |
|
1472 | 434 |
|
1729 | 435 |
!MIMETypes class methodsFor:'queries'! |
1472 | 436 |
|
1691
6ee1100ba672
defaultCommandPerMIME moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
437 |
defaultCommandPerMIME |
1729 | 438 |
"TODO: move this to OS/UserPreferences" |
1691
6ee1100ba672
defaultCommandPerMIME moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
439 |
|
6ee1100ba672
defaultCommandPerMIME moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
440 |
DefaultCommandPerMIMEPerOS isNil ifTrue:[ |
6ee1100ba672
defaultCommandPerMIME moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
441 |
self initializeDefaultCommands |
6ee1100ba672
defaultCommandPerMIME moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
442 |
]. |
6ee1100ba672
defaultCommandPerMIME moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
443 |
OperatingSystem isUNIXlike ifTrue:[ |
6ee1100ba672
defaultCommandPerMIME moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
444 |
^ DefaultCommandPerMIMEPerOS at:#unix |
6ee1100ba672
defaultCommandPerMIME moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
445 |
]. |
6ee1100ba672
defaultCommandPerMIME moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
446 |
^ DefaultCommandPerMIMEPerOS at:#win32 |
6ee1100ba672
defaultCommandPerMIME moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
447 |
! |
6ee1100ba672
defaultCommandPerMIME moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
448 |
|
647 | 449 |
defineImageType:mimeType suffix:aSuffix reader:aReaderClass |
450 |
"register an image reader." |
|
451 |
||
452 |
aSuffix notNil ifTrue:[ |
|
453 |
self imageReaderForSuffix:aSuffix put:aReaderClass. |
|
454 |
]. |
|
455 |
||
456 |
mimeType notNil ifTrue:[ |
|
457 |
self imageReaderForType:mimeType put:aReaderClass |
|
458 |
]. |
|
459 |
||
460 |
(aSuffix notNil and:[mimeType notNil]) ifTrue:[ |
|
461 |
self mimeTypeForSuffix:aSuffix put:mimeType |
|
462 |
]. |
|
463 |
! |
|
464 |
||
643 | 465 |
fileSuffixToImageReaderMapping |
1021 | 466 |
"return the suffix-to-imageReader mapping" |
467 |
||
643 | 468 |
^ FileSuffixToImageReaderClassMapping ? #() |
469 |
||
1021 | 470 |
"Modified: / 1.8.1998 / 17:00:11 / cg" |
643 | 471 |
! |
472 |
||
473 |
imageFileSuffixes |
|
1021 | 474 |
"return a collection with known file suffixes" |
475 |
||
643 | 476 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[^ #()]. |
477 |
^ FileSuffixToImageReaderClassMapping keys |
|
478 |
||
1021 | 479 |
"Created: / 30.6.1997 / 22:04:48 / cg" |
480 |
"Modified: / 1.8.1998 / 17:01:26 / cg" |
|
643 | 481 |
! |
482 |
||
1473 | 483 |
mimeTypeForFilename:filenameArg |
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
484 |
"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
|
485 |
|
1780
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
486 |
|type filename lcFilename suff suff2| |
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
487 |
|
1473 | 488 |
filename := filenameArg asFilename. |
1474 | 489 |
|
490 |
lcFilename := filename baseName asLowercase. |
|
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
491 |
type := FilenameToTypeMapping at:lcFilename ifAbsent:nil. |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
492 |
type isNil ifTrue:[ |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
493 |
"/ allow for fallback ... |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
494 |
type := OperatingSystem mimeTypeForFilename:lcFilename. |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
495 |
"/ 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
|
496 |
"/ 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
|
497 |
"/ the OS. |
1275 | 498 |
"/ type isNil ifTrue:[ |
499 |
"/ FilenameToTypeMapping at:lcFilename put:#unknown |
|
500 |
"/ ]. |
|
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
501 |
]. |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
502 |
|
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
503 |
type == #unknown ifTrue:[ |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
504 |
type := nil. |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
505 |
]. |
1273
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
506 |
|
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
507 |
type isNil ifTrue:[ |
1473 | 508 |
suff := filename suffix. |
1273
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
509 |
suff size ~~ 0 ifTrue:[ |
1780
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
510 |
"/ sigh - special code for multiple-suffices... |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
511 |
"/ .tar.gz -> tgz |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
512 |
suff2 := filename withoutSuffix suffix. |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
513 |
suff2 size > 0 ifTrue:[ |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
514 |
type := self mimeTypeForSuffix:(suff2 , '.' , suff). |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
515 |
]. |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
516 |
type isNil ifTrue:[ |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
517 |
type := self mimeTypeForSuffix:suff |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
518 |
]. |
1273
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
519 |
] |
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
520 |
]. |
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
521 |
|
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
522 |
^ type |
1780
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
523 |
|
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
524 |
" |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
525 |
self mimeTypeForFilename:'foo.gz' |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
526 |
self mimeTypeForFilename:'foo.tar' |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
527 |
self mimeTypeForFilename:'foo.tgz' |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
528 |
self mimeTypeForFilename:'foo.tar.gz' |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
529 |
" |
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
530 |
! |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
531 |
|
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
532 |
mimeTypeForFilename:filename put:mimeType |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
533 |
"register a mime type for a filename" |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
534 |
|
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
535 |
FilenameToTypeMapping isNil ifTrue:[ |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
536 |
FilenameToTypeMapping := Dictionary new |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
537 |
]. |
1612 | 538 |
FilenameToTypeMapping at:filename put:(MIMEType fromString:mimeType asLowercase) |
1611 | 539 |
! |
540 |
||
643 | 541 |
mimeTypeForSuffix:suffix |
1021 | 542 |
"given a file suffix, return the mime-type" |
543 |
||
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
544 |
|type lcSuffix| |
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
545 |
|
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
546 |
lcSuffix := suffix asLowercase. |
1300 | 547 |
lcSuffix = LastSuffix ifTrue:[ |
548 |
type := LastType |
|
549 |
] ifFalse:[ |
|
550 |
type := FileSuffixToTypeMapping at:lcSuffix ifAbsent:nil. |
|
551 |
type isNil ifTrue:[ |
|
552 |
"/ allow for fallback ... |
|
553 |
type := OperatingSystem mimeTypeForSuffix:lcSuffix. |
|
554 |
"/ the special value #unknown is returned as nil; |
|
555 |
"/ this avoids constant retry if a mimeType is not known in |
|
556 |
"/ the OS. |
|
557 |
"/ type isNil ifTrue:[ |
|
558 |
"/ FileSuffixToTypeMapping at:lcSuffix put:#unknown |
|
559 |
"/ ]. |
|
560 |
]. |
|
561 |
LastSuffix := lcSuffix. |
|
562 |
LastType := type. |
|
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
563 |
]. |
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
564 |
type == #unknown ifTrue:[ |
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
565 |
type := nil |
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
566 |
]. |
1612 | 567 |
type notNil ifTrue:[ |
568 |
^ MIMEType fromString:type |
|
569 |
]. |
|
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
570 |
^ type |
643 | 571 |
|
1666 | 572 |
" |
573 |
self mimeTypeForSuffix:'xml' |
|
574 |
" |
|
575 |
||
1021 | 576 |
"Created: / 30.6.1997 / 21:55:51 / cg" |
1300 | 577 |
"Modified: / 23.12.1999 / 22:30:55 / cg" |
643 | 578 |
! |
579 |
||
580 |
mimeTypeForSuffix:suffix put:mimeType |
|
1021 | 581 |
"register a mime type for a file suffix" |
582 |
||
643 | 583 |
FileSuffixToTypeMapping isNil ifTrue:[ |
584 |
FileSuffixToTypeMapping := Dictionary new |
|
585 |
]. |
|
586 |
FileSuffixToTypeMapping at:suffix put:mimeType asLowercase |
|
587 |
||
1021 | 588 |
"Created: / 30.6.1997 / 21:56:20 / cg" |
589 |
"Modified: / 1.8.1998 / 17:03:18 / cg" |
|
1593 | 590 |
! |
591 |
||
592 |
mimeTypeForSuffixMapping |
|
593 |
||
594 |
^ FileSuffixToTypeMapping |
|
1611 | 595 |
! |
596 |
||
597 |
mimeTypeOfContents:filename |
|
598 |
"given a filename, scan the contents, return the mime-type or nil, if unknown" |
|
599 |
||
1612 | 600 |
|typeString| |
601 |
||
602 |
typeString := filename mimeTypeOfContents. |
|
603 |
typeString isNil ifTrue:[^ nil]. |
|
604 |
^ MIMEType fromString:typeString. |
|
605 |
! ! |
|
606 |
||
1729 | 607 |
!MIMETypes class methodsFor:'queries-image formats'! |
608 |
||
609 |
imageReaderClasses |
|
610 |
"return a collection of registered image reader classes" |
|
611 |
||
612 |
|setOfClasses| |
|
613 |
||
614 |
setOfClasses := IdentitySet new. |
|
615 |
FileSuffixToImageReaderClassMapping notNil ifTrue:[ |
|
616 |
FileSuffixToImageReaderClassMapping keysAndValuesDo:[:suff :cls | |
|
617 |
setOfClasses add:cls |
|
618 |
]. |
|
619 |
]. |
|
620 |
TypeToImageReaderClassMapping notNil ifTrue:[ |
|
621 |
TypeToImageReaderClassMapping keysAndValuesDo:[:suff :cls | |
|
622 |
setOfClasses add:cls |
|
623 |
]. |
|
624 |
]. |
|
625 |
^ setOfClasses |
|
626 |
||
627 |
"Created: / 30.6.1997 / 22:03:42 / cg" |
|
628 |
"Modified: / 1.8.1998 / 16:59:52 / cg" |
|
629 |
! |
|
630 |
||
631 |
imageReaderForSuffix:aSuffix |
|
632 |
"given a file suffix, return an approriate image reader class" |
|
633 |
||
634 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[^ nil]. |
|
635 |
^ FileSuffixToImageReaderClassMapping at:aSuffix asLowercase ifAbsent:nil |
|
636 |
||
637 |
"Created: / 30.6.1997 / 21:59:11 / cg" |
|
638 |
"Modified: / 1.8.1998 / 17:01:58 / cg" |
|
639 |
! |
|
640 |
||
641 |
imageReaderForSuffix:aSuffix put:aReaderClass |
|
642 |
"register an image reader for a file suffix" |
|
643 |
||
644 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[ |
|
645 |
FileSuffixToImageReaderClassMapping := Dictionary new. |
|
646 |
]. |
|
647 |
FileSuffixToImageReaderClassMapping at:aSuffix asLowercase put:aReaderClass |
|
648 |
||
649 |
"Created: / 30.6.1997 / 21:59:43 / cg" |
|
650 |
"Modified: / 1.8.1998 / 17:02:14 / cg" |
|
651 |
! |
|
652 |
||
653 |
imageReaderForType:mimeTypeString |
|
654 |
"given a mime-type, return an approriate image reader class" |
|
655 |
||
656 |
TypeToImageReaderClassMapping isNil ifTrue:[^ nil]. |
|
657 |
^ TypeToImageReaderClassMapping at:mimeTypeString asLowercase ifAbsent:nil |
|
658 |
||
659 |
"Created: / 30.6.1997 / 21:56:01 / cg" |
|
660 |
"Modified: / 1.8.1998 / 17:02:28 / cg" |
|
661 |
! |
|
662 |
||
663 |
imageReaderForType:mimeTypeString put:aReaderClass |
|
664 |
"register an image reader for a mime-type" |
|
665 |
||
666 |
TypeToImageReaderClassMapping isNil ifTrue:[ |
|
667 |
TypeToImageReaderClassMapping := Dictionary new. |
|
668 |
]. |
|
669 |
TypeToImageReaderClassMapping at:mimeTypeString asLowercase put:aReaderClass |
|
670 |
||
671 |
"Created: / 30.6.1997 / 21:56:11 / cg" |
|
672 |
"Modified: / 1.8.1998 / 17:02:40 / cg" |
|
673 |
! ! |
|
674 |
||
675 |
!MIMETypes class methodsFor:'queries-language syntax'! |
|
676 |
||
677 |
commentStringsForFilename:aFilename |
|
678 |
"return a useful comment definition; heuristics for now. |
|
679 |
The returned value is an array of 2 elements; |
|
680 |
the first is the end-of-line comment string (or nil); |
|
681 |
the second an array of opening/closing delimiters (or an array of nils)" |
|
682 |
||
683 |
|mime| |
|
684 |
||
685 |
mime := MIMETypes mimeTypeForFilename:aFilename. |
|
686 |
^ self commentStringsForMimeType:mime suffix:(aFilename asFilename suffix) |
|
687 |
||
688 |
" |
|
689 |
MIMETypes commentStringsForFilename:'Makefile'. |
|
690 |
MIMETypes commentStringsForFilename:'Object.st'. |
|
691 |
MIMETypes commentStringsForFilename:'Foo.java'. |
|
692 |
" |
|
693 |
! |
|
694 |
||
695 |
commentStringsForFilename:aFilename ifUnknown:alternativeBlockReturningCommentString |
|
696 |
"return a useful comment definition; heuristics for now. |
|
697 |
The returned value is an array of 2 elements; |
|
698 |
the first is the end-of-line comment string (or nil); |
|
699 |
the second an array of opening/closing delimiters (or an array of nils)" |
|
700 |
||
701 |
|mime| |
|
702 |
||
703 |
mime := MIMETypes mimeTypeForFilename:aFilename. |
|
704 |
^ self commentStringsForMimeType:mime suffix:(aFilename asFilename suffix) ifUnknown:alternativeBlockReturningCommentString |
|
705 |
||
706 |
" |
|
707 |
MIMETypes commentStringsForFilename:'Makefile'. |
|
708 |
MIMETypes commentStringsForFilename:'Object.st'. |
|
709 |
MIMETypes commentStringsForFilename:'Foo.java'. |
|
710 |
" |
|
711 |
! |
|
712 |
||
713 |
commentStringsForMimeType:mime suffix:suff |
|
714 |
"return a useful comment definition; heuristics for now. |
|
715 |
The returned value is an array of 2 elements; |
|
716 |
the first is the end-of-line comment string (or nil); |
|
717 |
the second an array of opening/closing delimiters (or an array of nils)" |
|
718 |
||
719 |
^ self |
|
720 |
commentStringsForMimeType:mime suffix:suff |
|
721 |
ifUnknown: #(';' (nil nil)) |
|
722 |
||
723 |
" |
|
724 |
|mime| |
|
725 |
||
726 |
mime := MIMETypes mimeTypeForFilename:'Makefile'. |
|
727 |
MIMETypes commentStringsForMimeType:mime suffix:nil. |
|
728 |
" |
|
729 |
||
730 |
" |
|
731 |
|mime| |
|
732 |
||
733 |
mime := MIMETypes mimeTypeForFilename:'Object.st'. |
|
734 |
MIMETypes commentStringsForMimeType:mime suffix:nil. |
|
735 |
" |
|
736 |
! |
|
737 |
||
738 |
commentStringsForMimeType:mime suffix:suff ifUnknown:alternativeBlockReturningCommentString |
|
739 |
"return a useful comment definition; heuristics for now. |
|
740 |
The returned value is an array of 2 elements; |
|
741 |
the first is the end-of-line comment string (or nil); |
|
742 |
the second an array of opening/closing delimiters (or an array of nils)" |
|
743 |
||
744 |
|commentSpec| |
|
745 |
||
746 |
commentSpec := TypeToCommentStringMapping at:mime ifAbsent:nil. |
|
747 |
commentSpec notNil ifTrue:[ |
|
748 |
^ commentSpec |
|
749 |
]. |
|
750 |
||
751 |
commentSpec := SuffixToCommentStringMapping at:suff ifAbsent:nil. |
|
752 |
commentSpec notNil ifTrue:[ |
|
753 |
^ commentSpec |
|
754 |
]. |
|
755 |
||
756 |
^ alternativeBlockReturningCommentString value |
|
757 |
||
758 |
" |
|
759 |
|mime| |
|
760 |
||
761 |
mime := MIMETypes mimeTypeForFilename:'Makefile'. |
|
762 |
MIMETypes commentStringsForMimeType:mime suffix:nil. |
|
763 |
" |
|
764 |
||
765 |
" |
|
766 |
|mime| |
|
767 |
||
768 |
mime := MIMETypes mimeTypeForFilename:'Object.st'. |
|
769 |
MIMETypes commentStringsForMimeType:mime suffix:nil. |
|
770 |
" |
|
771 |
! ! |
|
772 |
||
1612 | 773 |
!MIMETypes::MIMEType class methodsFor:'documentation'! |
774 |
||
775 |
documentation |
|
776 |
" |
|
777 |
like a string, but knows that it represents a mimeType |
|
778 |
" |
|
779 |
! ! |
|
780 |
||
781 |
!MIMETypes::MIMEType class methodsFor:'initialization'! |
|
782 |
||
783 |
initialize |
|
784 |
CachedTypes := CacheDictionary new:30. |
|
785 |
||
786 |
" |
|
787 |
self initialize |
|
788 |
" |
|
789 |
! ! |
|
790 |
||
791 |
!MIMETypes::MIMEType class methodsFor:'instance creation'! |
|
792 |
||
793 |
fromString:aString |
|
794 |
|cachedType newType| |
|
795 |
||
796 |
aString class == self ifTrue:[^ aString]. |
|
797 |
||
798 |
cachedType := CachedTypes at:aString ifAbsent:nil. |
|
799 |
cachedType notNil ifTrue:[^ cachedType]. |
|
800 |
newType := aString copy changeClassTo:self. |
|
801 |
CachedTypes at:aString put:newType. |
|
802 |
^ newType |
|
803 |
||
804 |
" |
|
805 |
self fromString:'text/html' |
|
806 |
" |
|
807 |
! ! |
|
808 |
||
809 |
!MIMETypes::MIMEType methodsFor:'queries'! |
|
810 |
||
1693 | 811 |
isArchive |
1612 | 812 |
|archivTypes| |
813 |
||
1729 | 814 |
archivTypes := MIMETypes applicationCompressorsAndArchiveTypeList. |
1612 | 815 |
archivTypes pairWiseDo:[: ext : type | |
816 |
self = type ifTrue:[ ^ true]. |
|
817 |
]. |
|
818 |
^ false |
|
819 |
! |
|
820 |
||
821 |
isHtml |
|
822 |
||
823 |
^ (self = 'text/html') |
|
824 |
! |
|
825 |
||
826 |
isImage |
|
827 |
||
1693 | 828 |
^ (self startsWith:'image/') |
1612 | 829 |
! |
830 |
||
831 |
isPdf |
|
832 |
^ (self = 'application/pdf') |
|
833 |
! |
|
834 |
||
835 |
isSmalltalkSource |
|
836 |
^ (self = 'application/x-smalltalk-source') |
|
1783 | 837 |
! |
838 |
||
839 |
isXml |
|
840 |
^ (self = 'text/xml') |
|
643 | 841 |
! ! |
842 |
||
843 |
!MIMETypes class methodsFor:'documentation'! |
|
844 |
||
845 |
version |
|
1783 | 846 |
^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.58 2003-06-03 18:07:57 cg Exp $' |
643 | 847 |
! ! |
1666 | 848 |
|
643 | 849 |
MIMETypes initialize! |
1666 | 850 |
MIMETypes::MIMEType initialize! |