cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jorg Heymans (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COCOON-2022) broken URI handling in ZipSource
Date Thu, 15 Mar 2007 22:06:14 GMT

    [ https://issues.apache.org/jira/browse/COCOON-2022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12481339
] 

Jorg Heymans commented on COCOON-2022:
--------------------------------------

We need other people to test it, i'm still getting 

-------------------------------------------------------------------------------
Test set: org.apache.cocoon.components.source.impl.ZipSourceTestCase
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.078 sec <<< FAILURE!
testURIHandling(org.apache.cocoon.components.source.impl.ZipSourceTestCase)  Time elapsed:
0.063 sec  <<< FAILURE!
junit.framework.ComparisonFailure: Uri is wrong. expected:<zip:file:/[/]test.zip!/test.xml>
but was:<zip:file:/[]test.zip!/test.xml>
        at junit.framework.Assert.assertEquals(Assert.java:81)
        at org.apache.cocoon.components.source.impl.ZipSourceTestCase.testURIHandling(ZipSourceTestCase.java:28)


jorg:~/src/cocoon-trunk/core/cocoon-core jheymans$ svn st -u
Status against revision: 518773


i ran 'mvn clean install' from trunk root. Note that this is on mac os x

java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-164)
Java HotSpot(TM) Client VM (build 1.5.0_07-87, mixed mode, sharing)



> broken URI handling in ZipSource
> --------------------------------
>
>                 Key: COCOON-2022
>                 URL: https://issues.apache.org/jira/browse/COCOON-2022
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Jörg Heinicke
>         Assigned To: Jörg Heinicke
>            Priority: Minor
>
> On behalf of Leonid Geller: http://marc.theaimsgroup.com/?t=117337275500004&r=1&w=4:
> 1. Bug in org.apache.cocoon.components.source.impl.ZipSourceFactory, on this line:
>         // Get protocol. Protocol is configurable via cocoon.xconf
>         final String protocol = location.substring(0, protocolEnd - 1);
> Obviously it should be location.substring(0, protocolEnd). This is what causes zip to
be truncated to "zi".
> 2. When using a SYSTEM identifier with relative DTD path, the XML parser will look for
the file relative to the URI of the zipped source, zip:archive.zip!/source.xml which is obviously
going to fail.
> Here, the solution is to have the source implementation class (in this case org.apache.cocoon.components.source.impl.ZipSource)
to change getURI method to return source.xml based on archive.zip location, w/o the zip protocol.
Current implementation:
> 	return this.protocol + this.archive.getURI() + "!/" + this.filePath;
> is not going to work. Something like this will:
>     	int iZipIdx = this.archive.getURI().lastIndexOf("/");
> 	if (iZipIdx < 0) iZipIdx = 0;
>     	return this.archive.getURI().substring(0,iZipIdx)+"/"+ this.filePath;

-- 
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