MIMETypes.st
changeset 1609 090ee7aa4cab
parent 1606 158c10a36736
child 1610 34bb3a9f1379
--- a/MIMETypes.st	Wed Sep 11 14:52:31 2002 +0200
+++ b/MIMETypes.st	Wed Sep 11 17:04:14 2002 +0200
@@ -92,14 +92,25 @@
     )
 !
 
+applicationMiscTypeList
+    "misc applications"
+
+    ^ #(
+        ('a' 'o' 'obj' )                        'application/binary'
+        'a'                                     'application/library'
+        ('dll' 'so')                            'application/shared-library'
+    )
+!
+
 applicationProgLangTypeList
     "applications for programm languages"
 
     ^ #(
-        ('st' 'cls')                 'application/x-smalltalk-source'
+        ('st' 'cls' 'rc')            'application/x-smalltalk-source'
         'sif'                        'application/x-smalltalk-source-sif'
         'c'                          'application/x-c-source'
         ('cc' 'cpp')                 'application/x-cpp-source'
+        ('h' 'hi')                   'application/x-c-header'
         ('js' 'mocha')               'application/x-javascript'
         ('java' 'jav')               'application/x-java-source'
         'sh'                         'application/x-sh'
@@ -126,12 +137,13 @@
 applicationTypeList
     "applications"
 
-    |types|                            
+    |types|                              
 
     types := OrderedCollection new.
     types addAll:self applicationProgLangTypeList.
     types addAll:self applicationTextTypeList.
     types addAll:self applicationComprAndArchiveTypeList.
+    types addAll:self applicationMiscTypeList.
     ^ types
 !
 
@@ -200,7 +212,10 @@
     types addAll:self videoTypeList.
     types addAll:self audioTypeList.
     types addAll:self applicationTypeList.
-    types pairWiseDo:[:suff :type|
+    types pairWiseDo:[:suff :typeString|
+        |type|
+
+        type := MIMEType fromString:typeString.
         suff isArray ifTrue:[
             suff do:[:s | fileSuffixToTypeMapping at:s put:type]
         ] ifFalse:[
@@ -211,7 +226,10 @@
     FilenameToTypeMapping := Dictionary new.
     #(
         ('makefile' 'make.proto')  'application/x-make'
-    ) pairWiseDo:[:nm :type|
+    ) pairWiseDo:[:nm :typeString|
+        |type|
+
+        type := MIMEType fromString:typeString.
         nm isArray ifTrue:[
             nm do:[:s | FilenameToTypeMapping at:s put:type]
         ] ifFalse:[
@@ -269,6 +287,14 @@
     "Modified: / 19.11.1999 / 15:01:53 / cg"
 !
 
+miscFilenameList
+    "other formats (not by suffix, but by fileName isnstead) ..."
+
+    ^ #(
+        ('makefile' 'make.proto')  'application/x-make'
+    )
+!
+
 textTypeList
    "/ misc text ...
 
@@ -629,6 +655,6 @@
 !MIMETypes class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.38 2002-09-10 15:05:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.39 2002-09-11 15:04:14 penk Exp $'
 ! !
 MIMETypes initialize!