Return-Path: Mailing-List: contact user-help@ant.apache.org; run by ezmlm Delivered-To: mailing list user@ant.apache.org Received: (qmail 98080 invoked from network); 5 Mar 2003 08:37:33 -0000 Received: from dnsinet.rzf-nrw.de (193.109.238.66) by daedalus.apache.org with SMTP; 5 Mar 2003 08:37:33 -0000 Received: from z011104.bk.fin.local (z011104.bk.fin.local [193.109.238.140]) by dnsinet.rzf-nrw.de (8.12.3/8.12.3) with ESMTP id h258bggN026506 for ; Wed, 5 Mar 2003 09:37:42 +0100 Received: by z011104.bk.fin.local with Internet Mail Service (5.5.2653.19) id ; Wed, 5 Mar 2003 09:37:43 +0100 Message-ID: <879A5AD5DD0ED511891F0003473A9B5603CCC2FD@Z011004> From: Jan.Materne@rzf.fin-nrw.de To: user@ant.apache.org Subject: AW: Bugzilla #6266, my workarround. Date: Wed, 5 Mar 2003 09:37:42 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C2E2F2.7CDDAA20" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C2E2F2.7CDDAA20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Why you don=B4t make an attachement to that ID? http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3D6266 So it wouldn=B4t be forgotten. And that is the right place (as I know). Especially if there is already an ID. Jan Mat=E8rne -----Urspr=FCngliche Nachricht----- Von: Nestel, Frank IZ/HZA-IC4 [mailto:nestefan@de.ina.com] Gesendet am: Mittwoch, 5. M=E4rz 2003 09:35 An: 'Ant Users List' Betreff: AW: Bugzilla #6266, my workarround. Hmm, seems as attachments do not get through to the list. Guess I could have read it somewhere, but there are so many lists ...=20 Here is the source as textual inclusion: package de.spieleck.helper; import java.io.File; import java.io.IOException; import java.io.InputStream; import org.apache.tools.zip.ZipOutputStream; import org.apache.tools.ant.taskdefs.Zip; /** * Create a Zipfile allow relocation of zipfile contents. * That is, we have an extra attribute <globalprefix> * which is textually prepended to all names in zipfile. For example * you can use *
 *  <taskdef classname=3D"de.spieleck.helper.PrefixZipTask" =
name=3D"xzip"
 *        classpath=3D"${name}.jar" />
 *  <xzip zipfile=3D"${release.zip}" =
globalprefix=3D"${zip.prefix}/">
 *    <fileset refid=3D"releaseFileset"/>
 *    <fileset refid=3D"sampleFileset"/>
 *  </xzip>
 * 
* with filesets instead of zipfilesets. */ public class PrefixZipTask extends Zip { /** Allow a global prefix for names within the Zipfile */ protected String globalPrefix =3D null; /**=20 * Allow a global prefix for names within the Zipfile=20 * @param globalPrefix the String to prefix all names. */ public void setGlobalPrefix(String globalPrefix) { this.globalPrefix =3D globalPrefix; } /** * Patch the path for inclusion in zipfile. * @param vPath the unpatched path * @return the patched path */ protected String zipPath(String vPath) { return globalPrefix =3D=3D null ? vPath : globalPrefix + vPath; } /** * Patch zipDir(), insert {@link globalPrefix} if appropriate. * @since patch */ protected void zipDir(File dir, ZipOutputStream zOut, String vPath, int mode) throws IOException=20 { super.zipDir(dir, zOut, zipPath(vPath), mode); } /** * Patch zipFile(), insert {@link globalPrefix} if appropriate. * @since patch */ protected void zipFile(InputStream in, ZipOutputStream zOut, String vPath, long lastModified, File fromArchive, int = mode) throws IOException=20 { super.zipFile(in, zOut, zipPath(vPath), lastModified,fromArchive,mode); } /** * @since patch */ public void reset() { globalPrefix =3D null; super.reset(); } } > -----Urspr=FCngliche Nachricht----- > Von: Nestel, Frank IZ/HZA-IC4 [mailto:nestefan@de.ina.com]=20 > Gesendet: Dienstag, 4. M=E4rz 2003 15:59 > An: 'Ant Users List' > Betreff: Bugzilla #6266, my workarround. >=20 >=20 > Attached find my personal solution to bugzilla #6266. > It is almost trivial, but very helpful in my setting. > Maybe someone can build that into the mainstream of the > zip task. I cannot see any special reason why it is not > there. >=20 > Thanks. > Frank >=20 >=20 >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org ------_=_NextPart_001_01C2E2F2.7CDDAA20--