From: Florian G. H. <fg...@bk...> - 2002-06-10 06:00:23
|
Hello, On Friday 07 June 2002 16:40, Kal Ahmed wrote: | This lack of source URL is a big hole in the InputStream interface IMHO= =2E | But given that we can't change that (unless anyone knows a developer in= the | Java team ;-), then I think that there needs to be some default rules f= or | assigning a URL to the stream. I propose that : | | 1) each file can be assigned a base url with a parameter following the = file | name: | org.tm4j.topicmap.cmd.Merge -o output.xtm foo.xtm -baseurl | http://www.mysite.com/tms/foo.xtm bar.xtm -baseurl | http://www.mysite.com/tms/bar.xtm | This has the advantage that I can use local copies of the files for the | merge process yet still have them treated as if they originated from th= e | online sources. Good idea, but it can't be done using JArgs (as far as I know). So we wou= ld=20 throw out much of the flexibility we've gained using JArgs by having to w= rite=20 our own parsing routine again. Or is there an alternative to JArgs which = does=20 support the structure you propose?=20 | 2) if no base url is specified and the input source is specified on the | command line generate the URL from the input file name, so "foo.xtm" wo= uld | be resolved as a File then you can use File.toURL() to get a locator fo= r | the input source. "http://someurl.com/foo.xtm" would fail to resolve as= a | file, so you could convert that to a URL, get the URLConnection for the | source and use the URL itself as the base url | | 3) if no base url is specified and the input source comes from a pipe, = then | use some default URL (could it be based on the current working directo= ry | ?) OK, but TopicMapProviderBase doesn't support any of that yet. It needs an= =20 overloaded readTopicMap() method which accepts and InputStream and a Stri= ng=20 representing a system ID. Still, even if it's useless, I suggest that we at least drop Sun a note t= hat=20 something like a URLConnectionInputStream is more than needed. We're prob= ably=20 just a few out of thousands, but at least it's worth telling them. Later, -- Florian --=20 Florian G. Haas <fg...@bk...> GnuPG public key: http://www.fgh.bkf.at/gpgkey.asc Key fingerprint: 3C24 E021 33B1 9E98 B94B 2F21 860A B693 1B33 BB3C |