Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 14292 invoked from network); 14 Mar 2007 21:25:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Mar 2007 21:25:37 -0000 Received: (qmail 10582 invoked by uid 500); 14 Mar 2007 21:25:39 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 10491 invoked by uid 500); 14 Mar 2007 21:25:39 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 10390 invoked by uid 99); 14 Mar 2007 21:25:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Mar 2007 14:25:38 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Mar 2007 14:25:30 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D99B2714080 for ; Wed, 14 Mar 2007 14:25:09 -0700 (PDT) Message-ID: <11654719.1173907509889.JavaMail.jira@brutus> Date: Wed, 14 Mar 2007 14:25:09 -0700 (PDT) From: "Jorg Heymans (JIRA)" To: dev@cocoon.apache.org Subject: [jira] Commented: (COCOON-2022) broken URI handling in ZipSource In-Reply-To: <11256148.1173733749242.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COCOON-2022?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12480939 ]=20 Jorg Heymans commented on COCOON-2022: -------------------------------------- Could it be that this fix breaks a testcase ? On my local CI build i get : Running org.apache.cocoon.components.source.impl.ZipSourceTestCase [DEBUG] SourceResolver: Using base URL: file:/home/maven/.hudson/jobs/Cocoo= n/workspace/trunk/core/cocoon-core/ [DEBUG] Resolving 'zip:file://test.zip!/test.xml' with base 'null' in conte= xt 'file:/home/maven/.hudson/jobs/Cocoon/workspace/trunk/core/cocoon-core/' [DEBUG] Resolved to systemID : zip:file://test.zip!/test.xml [DEBUG] Resolving 'file://test.zip' with base 'null' in context 'file:/home= /maven/.hudson/jobs/Cocoon/workspace/trunk/core/cocoon-core/' [DEBUG] Resolved to systemID : file://test.zip [DEBUG] Creating source object for file://test.zip Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.053 sec <= << FAILURE! > 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=C3=B6rg Heinicke > Assigned To: J=C3=B6rg Heinicke > Priority: Minor > > On behalf of Leonid Geller: http://marc.theaimsgroup.com/?t=3D11733727550= 0004&r=3D1&w=3D4: > 1. Bug in org.apache.cocoon.components.source.impl.ZipSourceFactory, on t= his line: > // Get protocol. Protocol is configurable via cocoon.xconf > final String protocol =3D location.substring(0, protocolEnd - 1); > Obviously it should be location.substring(0, protocolEnd). This is what c= auses 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:archiv= e.zip!/source.xml which is obviously going to fail. > Here, the solution is to have the source implementation class (in this ca= se org.apache.cocoon.components.source.impl.ZipSource) to change getURI met= hod to return source.xml based on archive.zip location, w/o the zip protoco= l. Current implementation: > =09return this.protocol + this.archive.getURI() + "!/" + this.filePath; > is not going to work. Something like this will: > =09int iZipIdx =3D this.archive.getURI().lastIndexOf("/"); > =09if (iZipIdx < 0) iZipIdx =3D 0; > =09return this.archive.getURI().substring(0,iZipIdx)+"/"+ this.filePa= th; --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.