--- a/MIMEType.st Wed Sep 11 14:52:31 2002 +0200
+++ b/MIMEType.st Wed Sep 11 17:04:14 2002 +0200
@@ -1,10 +1,10 @@
"{ Package: 'stx:libview2' }"
String variableByteSubclass:#MIMEType
- instanceVariableNames:''
- classVariableNames:'CachedTypes'
- poolDictionaries:''
- category:'System-Documentation'
+ instanceVariableNames:''
+ classVariableNames:'CachedTypes'
+ poolDictionaries:''
+ category:'System-Documentation'
!
@@ -40,8 +40,7 @@
|archivTypes|
- mimeType isNil ifTrue:[^ false].
- archivTypes := self class applicationComprAndArchiveTypeList.
+ archivTypes := MIMETypes applicationComprAndArchiveTypeList.
archivTypes pairWiseDo:[: ext : type |
self = type ifTrue:[ ^ true].
].
@@ -60,11 +59,16 @@
isPdf
^ (self = 'application/pdf')
+!
+
+isSmalltalkSource
+
+ ^ (self = 'application/x-smalltalk-source')
! !
!MIMEType class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/Attic/MIMEType.st,v 1.3 2002-09-11 12:52:31 penk Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/Attic/MIMEType.st,v 1.4 2002-09-11 15:04:08 penk Exp $'
! !
MIMEType initialize!
--- 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!