ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nestel, Frank IZ/HZA-IC4" <neste...@de.ina.com>
Subject AW: Bugzilla #6266, my workarround.
Date Wed, 05 Mar 2003 08:56:33 GMT
Hmm, cause the ID is over a year old and it took me
less than a hour to fix it though I looked at that 
Zip task for the first time. 

I had the suspicion that it was a "lost case" in bugzilla.

<flame please="ignore">
Furthermore it seems like I have to go through another tedious
registration process to do so. I'm currently subscribed to 
more lists and systems on the internet than I can actually handle.

Sorry :-)
</flame>

Anyway, I've attached it to the bug. And I could easily build
it in the original class if it helped someone

> -----Ursprüngliche Nachricht-----
> Von: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de] 
> Gesendet: Mittwoch, 5. März 2003 09:38
> An: user@ant.apache.org
> Betreff: AW: Bugzilla #6266, my workarround.
> 
> 
> Why you don´t make an attachement to that ID? 
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6266
> 
> So it wouldn´t be forgotten. And that is the right place
> (as I know). Especially if there is already an ID.
> 
> 
> Jan Matèrne
> 
> -----Ursprüngliche Nachricht-----
> Von: Nestel, Frank IZ/HZA-IC4 [mailto:nestefan@de.ina.com] 
> Gesendet am: Mittwoch, 5. März 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 ... 
> 
> 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 &lt;globalprefix&gt;
>  * which is textually prepended to all names in zipfile. For example
>  * you can use
>  * <pre>
>  *  &lt;taskdef classname="de.spieleck.helper.PrefixZipTask" 
> name="xzip"
>  *        classpath="${name}.jar" />
>  *  &lt;xzip zipfile="${release.zip}" globalprefix="${zip.prefix}/">
>  *    &lt;fileset refid="releaseFileset"/>
>  *    &lt;fileset refid="sampleFileset"/>
>  *  &lt;/xzip>
>  * </pre>
>  * with filesets instead of zipfilesets.
>  */
> public class PrefixZipTask extends Zip {
> 
>     /** Allow a global prefix for names within the Zipfile */
>     protected String globalPrefix = null;
> 
>     /** 
>      * Allow a global prefix for names within the Zipfile 
>      * @param globalPrefix the String to prefix all names.
>      */
>     public void setGlobalPrefix(String globalPrefix)
>     {
>         this.globalPrefix = globalPrefix;
>     }
> 
>     /**
>      * Patch the path for inclusion in zipfile.
>      * @param vPath the unpatched path
>      * @return the patched path
>      */
>     protected String zipPath(String vPath)
>     {
>         return globalPrefix == 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 
>     {
>         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 
>     {
>         super.zipFile(in, zOut, zipPath(vPath),
> lastModified,fromArchive,mode);
>     }
> 
>     /**
>      * @since patch
>      */
>     public void reset() {
>         globalPrefix = null;
>         super.reset();
>     }
> 
> }
> 
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Nestel, Frank IZ/HZA-IC4 [mailto:nestefan@de.ina.com]
> > Gesendet: Dienstag, 4. März 2003 15:59
> > An: 'Ant Users List'
> > Betreff: Bugzilla #6266, my workarround.
> > 
> > 
> > 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.
> > 
> > Thanks.
> > Frank
> > 
> > 
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
View raw message