[Seaside-dev] #readMimeDatabase

Esteban A. Maringolo emaringolo at gmail.com
Wed Oct 31 16:42:41 UTC 2007


Hello,

I am (again) in the process of porting Seaside, this time 2.8 lr-522,
to Dolphin.
In this occasion with time officially assigned from my company (last
times it was in my spare time at home).
So I'll be a little more active here than before.

First of all:
I'm not acquainted with Monticello, so I made some modifications to
PackageExporters (to support Dolphin), but I don't know how retrofit
it to the public repository. If somebody is willing to help me...

Now to the point...

The #readMimeDatabase method in WAStandardLibraries assumes the
platform is some variation of Linux/Unix, perhaps readMimeDatabase
should be refactored and placed in SeasidePlatformSupport, so I can
access (in windows) to a mime.types file distributed by myself, or
just answer a pre built dictionary.

readMimeDatabase
	"reads /etc/mime.types for mime types"
	| stream content types tokens value keys |
	stream := CrLfFileStream readOnlyFileNamed: '/etc/mime.types'.
	content := [ stream contentsOfEntireFile ]
		ensure: [ stream close ].
	types := Dictionary new.
	content linesDo: [ :each |
		(each isEmpty or: [ each first = $# ]) ifFalse: [
			tokens := each findTokens: String tab.
			tokens size > 1 ifTrue: [
				value := tokens first.
				keys := tokens second findTokens: ' '.
				keys do: [ :key |
					types at: key put: value ] ] ] ].
	^types

Best regards,

-- 
Esteban A. Maringolo
http://dolphinseaside.blogspot.com
eMaringolo at gmail.com


More information about the seaside-dev mailing list