[Seaside-dev] #readMimeDatabase

Philippe Marschall philippe.marschall at gmail.com
Wed Oct 31 17:37:09 UTC 2007


2007/10/31, Esteban A. Maringolo <emaringolo at gmail.com>:
> 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.

No, if you have a closer look you'll see that this method was used to
create the method defaultMimeTypes. It's only there if a some point in
the future someone want to recreate the method. Similar to the methods
for generating brush methods that were once in WACanvas and I still
miss. You don't need it, you can just exclude it.

Cheers
Philippe

> 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
> _______________________________________________
> seaside-dev mailing list
> seaside-dev at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>


More information about the seaside-dev mailing list