cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Klamar <sebi+lists.cocoon-...@tux.wh17.tu-dresden.de>
Subject Why does <SitemapSource>.getContentLength() return -1?
Date Wed, 03 Dec 2003 16:10:45 GMT
or: Strange impl of SitemapSource for getContentLength, getMimeType(),
    exists()

Why does SitemapSource's

  1. getContentLength() return -1,
  2. getMimeType() return text/xml,
  3. exists() return true,

always?

  a. Was it a quick hack?
  b. Or couldn't the initial developer create a reliable impl that works
     for all cases?

I invested more time into (1) and found out that
getInputStream().available() returns the same content length as when the
resource is resolved via http:// (invokes excalibur's URLSource) instead
of cocoon:/  Don't know whether the available() method is reliable for
us.  The API Doc for InputSource says: »Returns the number of bytes that
can be read (or skipped over) from this input stream without blocking by
the next caller of a method for this input stream.«  What do you think?

So if (a) applys and for (1) feat. available() noone demurs I would
invest more time to supply a patch into Bugzilla.

Any hints to resolve problems (2) and (3)?


TIA -- Sebastian

-- 
Die letzten Worte...
          des Gerichtsvollziehers: "Und die Pistole ist auch gepfändet."
************************************************************************
PGP Key: 0x1E727CE6 / 9085 48BD 8332 4BFC D80C  A6CF D162 20BB 1E72 7CE6

Mime
View raw message