jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Parvulescu <alex.parvule...@gmail.com>
Subject Re: Session.importXml should close the input stream?
Date Fri, 25 Feb 2011 09:19:53 GMT
ok, done :)

https://issues.apache.org/jira/browse/JCR-2903

<https://issues.apache.org/jira/browse/JCR-2903>thanks,
alex

On Thu, Feb 24, 2011 at 3:40 PM, Stefan Guggisberg <
stefan.guggisberg@gmail.com> wrote:

> On Wed, Feb 23, 2011 at 3:04 PM, Alex Parvulescu
> <alex.parvulescu@gmail.com> wrote:
> > Hello,
> >
> > I was going through the Hops examples and I noticed something that I
> don't
> > understand in Hop 3.
> > The Session.importXml api [1] says that the input stream will be closed
> by
> > the session: "The passed InputStream is closed before this method returns
> > either normally or because of an exception."
> > Which does not seem to be the case for the example.
> > I also looked at org.apache.jackrabbit.jcr2spi.SessionImpl which does not
> > appear to close the input stream.
> >
> > Is there something I'm missing here? Who is in charge of closing the
> input
> > stream in the end?
>
> JSR 170 (-> JCR 1.0) did not specify who's responsible for closing
> an InputStream instance passed to an api method.
>
> jackrabbit < 2.0 did not close the passed streams, the api consumer
> was responsible for closing the stream after the api method returned.
>
> JSR 283 (-> JCR 2.0) finally specified that that the following methods
> will close the passed InputStream before returning control to the caller:
>
>    Node.setProperty(String, InputStream)
>    Property.setValue(InputStream)
>    ValueFactory.createValue(InputStream)
>    ValueFactory.createBinary(InputStream)
>    Session.importXML(String, InputStream, int)
>    Workspace.importXML(String, InputStream, int)
>
> jackrabbit apparently does not yet comply with the
> new JCR 2.0 stream handling contract.
>
> do you mind filing a jira issue?
>
> thanks
> stefan
>
>
> >
> >
> >
> > [1]
> http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Session.html#importXML(java.lang.String
> ,
> > java.io.InputStream, int)
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message