yeah, it would. I was doing it under the assumption I don't want to change the source for cassandra but I'll work on putting it into contrib and add that c'tor as well.
2010/1/25 Ted Zlatanov <t...@lifelogs.com> > On Sun, 24 Jan 2010 13:56:07 +0200 Ran Tavory <ran...@gmail.com> wrote: > > RT> On Sun, Jan 24, 2010 at 1:16 PM, gabriele renzi <rff....@gmail.com> > wrote: > > >> On Sun, Jan 24, 2010 at 11:02 AM, Ran Tavory <ran...@gmail.com> wrote: > >> > Here's the code I've just written over the weekend and started using > in > >> > test: > >> > >> <snip> > >> Thanks for sharing :) > >> A quick note on the code from a superficial look: instead of the > >> hardwired "tmp" string I think it would make more sense to use the > >> system's tmp dir ( System.getProperty("java.io.tmpdir")). > >> > >> I'd say something like this deserves to be present in the cassandra > >> distribution, or at least put in some public repo (github, > >> code.google, whatever), what do other people think? > > RT> agreed on the System.getProperty("java.io.tmpdir") > RT> I can put this under contrib if you think it's useful. > > Maybe it would make sense to also add a constructor to XMLUtils to > accept a configuration directly from an InputStream instead of just a > String filename. Then all these tmpdir games can be avoided. > DocumentBuilder, which is used behind the scenes, already does this so > it's a simple patch to add this constructor to XMLUtils.java: > > public XMLUtils(InputStream xmlIS) throws ParserConfigurationException, > SAXException, IOException > { > DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); > DocumentBuilder db = dbf.newDocumentBuilder(); > document_ = db.parse(xmlIS); > > XPathFactory xpathFactory = XPathFactory.newInstance(); > xpath_ = xpathFactory.newXPath(); > } > > Ted > >