URL changes, the trailing slash is striking again
Lex Spoon
lex at lexspoon.org
Fri Feb 16 23:45:46 UTC 2007
"Lukas Renggli" <renggli at gmail.com> writes:
> > FWIW, the URL classes in the image handle this. They were written
> > back in '98 and have been carefully updated since then as problems
> > come up. The approach is that a trailing slash mean the last part
> > of the path is an empty string. To continue with this example:
> >
> > FileUrl pathParts: #('files' 'basic.css')
> > "yields file:///files/basic.css"
> >
> > FileUrl pathParts: #('files' 'basic.css' '')
> > "yields file:///files/basic.css/"
>
> Interesting, I didn't know that these existed. What they are used for?
> What is the difference to FileDirectory? HTTPSocket, KomServer and
> friends doesn't seem to use them.
They are the built-in URL classes of Squeak, no more nor less.
Scamper and Celeste use them, and they themselves use HTTPSocket for
downloading http:// url's. For the others in your list, IMHO
ServerDirectory might benefit from them, and I don't know whether
KomServer actually processes any URL's. If it does, then maybe they
could help KomServer, too.
They also make for cute one-liners. :) Googling turned
up this one:
(HtmlParser parse: 'http://www.squeak.org/' asUrl
retrieveContents content) explore
http://wiki.squeak.org/squeak/1395
-Lex
More information about the Squeak-dev
mailing list
|