jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Grabski (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-2079) InputStream - stream closed in unpack() method
Date Mon, 20 Apr 2009 09:14:47 GMT
InputStream - stream closed in unpack() method
----------------------------------------------

                 Key: JCR-2079
                 URL: https://issues.apache.org/jira/browse/JCR-2079
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-classloader
    Affects Versions: 1.5.0
            Reporter: Lukasz Grabski


Hi there :)

I'm currently working with jackrabbit classloader component, and I've
discovered a bug I suppose ...

In ExpandingArchiveClassPathEntry class there is a method that is used
to unpack a JAR file - unpack() - then it calls a method unpackFile()
when it founds a file in processed archive.  

When it calls content.setProperty("jcr:data", ins);

the stream is not available for further processing in unpack() method,
I've created a little patch:

ByteArrayOutputStream tmpStream = new ByteArrayOutputStream();
try {
        IOUtils.copy(ins, tmpStream); // from commons-io
} catch (IOException e) {
        throw new RepositoryException(e);
}

....

content.setProperty("jcr:data", new
ByteArrayInputStream(tmpStream.toByteArray()));

now it works perfectly :)

PS: I'm using 1.5 version of jackrabbit classloader

Best regards,
Lukasz Grabski

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message