ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Stillwell <>
Subject RE: un(jar/war/zip) & filesets...
Date Thu, 15 Mar 2001 17:08:08 GMT

This is already handled with zipfileset, like this:

<zipfileset src="${jini_home}/sun-util.jar"

Chris Stillwell

-----Original Message-----
From: Dennis Brake []
Sent: Thursday, March 15, 2001 9:52 AM
To: ''
Subject: RE: un(jar/war/zip) & filesets...

I haven't followed all of this thread so I don't know if my needs
are the same as Julian's. What I would like to see is a way to
extract files (that match a pattern) from a zip/jar file.

We are developing jini code and there is a class in one of sun's
jar files that needs to be extracted and copied to a development
directory. The way I do it now is to create a temp directory, unzip
the file to this directory, copy the single file that I need to my
development tree, and delete the temp directory. For example,

    <mkdir   dir="${project.temp}" />
    <unjar src="${java.jini}/lib/jini-ext.jar" dest="${project.temp}" />
    <copy todir="${project.output}">
        <fileset dir="${project.temp}">
           <include name="net/jini/lookup/*_Stub.class" />
    <delete  dir="${project.temp}" />

I think a good general solution that would solve my problem, and
possibly others, would be to extend the fileset to allow zip/jar
to be added either as a dir or with another property (e.g. zip).
So my above tasks could be reduced to:

    <copy todir="${project.output}">
        <fileset dir="{java.jini}/lib/jini-ext.jar">
           <include name="net/jini/lookup/*_Stub.class" />

    <copy todir="${project.output}">
        <fileset zip="{java.jini}/lib/jini-ext.jar">
           <include name="net/jini/lookup/*_Stub.class" />

> -----Original Message-----
> From: Stefan Bodewig []
> Sent: Thursday, March 15, 2001 9:18 AM
> To:
> Subject: Re: un(jar/war/zip) & filesets...
> Julian gosnell <> wrote:
> > I have played a little bit with zipfileset and found the mention of
> > it in the 1.3 documentation. Unfortunately it's not going to do what
> > I want.
> >
> > It is treating one zipfile as a fileset
> Yes, this is what it does. I thought you could get away with
> explicitly listing the zipfiles you need to read from for your <jar>
> task. As this is not the case ... no there currently is no way to
> achieve what you want, sorry.
> Stefan

View raw message