You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Sunils_82 <su...@yahoo.com> on 2009/01/27 14:36:11 UTC
Unzip specific folders in ANT
Hi,
I have a zip file with multiple folders in it.
Instead of extracting the whole contents present in ZIP-File, is it possible
to extract only the specific folders that is required for me?
Regards,
Sunil
--
View this message in context: http://www.nabble.com/Unzip-specific-folders-in-ANT-tp21685421p21685421.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: AW: Unzip specific folders in ANT
Posted by Andy Stevens <in...@googlemail.com>.
2009/1/27 Sunils_82 <su...@yahoo.com>:
> I'm using the sample specified in the ANT
>
> <unzip src="${resource.dir}/sample.zip" dest="${resource.dir}/images">
> <patternset>
> <include name="**/*.gif"/>
> <include name="**/*.GIF"/>
...
> But this extracts contents from all the folders present in the zip file.
Take a guess at what the "**" wildcard means...
> Wanted to know how to specify the folder name from which these gif files are
> to be extracted.
<include name="just_from_this_folder/*.gif"/>
but using the relevant folder name, obviously.
Andy
--
http://pseudoq.sourceforge.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
AW: AW: AW: Unzip specific folders in ANT
Posted by Ja...@rzf.fin-nrw.de.
>I tried the wildcard from your example:
> <include name="images/"/>
>
>This worked as i expected.
>Thanks a lot Jan
I added these two examples to the manual.
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: AW: AW: Unzip specific folders in ANT
Posted by Sunils_82 <su...@yahoo.com>.
Hi Jan,
I tried the wildcard from your example:
<include name="images/"/>
This worked as i expected.
Thanks a lot Jan
Regards,
Sunil
--
View this message in context: http://www.nabble.com/Unzip-specific-folders-in-ANT-tp21685421p21701022.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
AW: AW: Unzip specific folders in ANT
Posted by Ja...@rzf.fin-nrw.de.
>I tried with the wildcard that you provided and checked with
>verbose option.
>Extracting of files doesn't seem to happen for specified folder names.
This works for me:
<project>
<mkdir dir="_allImages_"/>
<unzip src="${ant.home}/lib/ant.jar" dest="_allImages_">
<patternset>
<include name="images/"/>
</patternset>
</unzip>
<mkdir dir="_selectedFiles_"/>
<unzip src="${ant.home}/lib/ant.jar" dest="_selectedFiles_">
<patternset>
<include name="**/ant_logo_large.gif"/>
<include name="**/LICENSE.txt"/>
</patternset>
</unzip>
</project>
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: AW: Unzip specific folders in ANT
Posted by Sunils_82 <su...@yahoo.com>.
Hi Mark,
I tried with the wildcard that you provided and checked with verbose option.
Extracting of files doesn't seem to happen for specified folder names.
Regards,
Sunil
--
View this message in context: http://www.nabble.com/Unzip-specific-folders-in-ANT-tp21685421p21699788.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: AW: Unzip specific folders in ANT
Posted by Mark Salter <ma...@talktalk.net>.
Sunils_82 wrote:
> Yes i tried specifying the wildcard using the folder name as mentioned below
>
> <include name="**/resource/images/*.gif"/>
>
> But this didn't extract the contents under the ./resource/images folder.
>
>
Should \ vs / matter? It seems to for me...
Can you try :-
<include name="**\resource\images\*.gif"/>
please? Perhaps include the output from "ant -verbose"?
--
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: AW: Unzip specific folders in ANT
Posted by Sunils_82 <su...@yahoo.com>.
Yes i tried specifying the wildcard using the folder name as mentioned below
<include name="**/resource/images/*.gif"/>
But this didn't extract the contents under the ./resource/images folder.
--
View this message in context: http://www.nabble.com/Unzip-specific-folders-in-ANT-tp21685421p21686278.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: AW: Unzip specific folders in ANT
Posted by Mark Salter <ma...@talktalk.net>.
Sunils_82 wrote:
> I'm using the sample specified in the ANT
>
> <unzip src="${resource.dir}/sample.zip" dest="${resource.dir}/images">
> <patternset>
> <include name="**/*.gif"/>
> <include name="**/*.GIF"/>
> </patternset>
> </unzip>
>
> But this extracts contents from all the folders present in the zip file.
All files with the extension of .gif and .GIF from all of the folders?
>
> Wanted to know how to specify the folder name from which these gif files are
> to be extracted.
Did you try changing the wild card folder component in the include from
'**/' to include the folder name you want to extract?
--
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: AW: Unzip specific folders in ANT
Posted by Sunils_82 <su...@yahoo.com>.
I'm using the sample specified in the ANT
<unzip src="${resource.dir}/sample.zip" dest="${resource.dir}/images">
<patternset>
<include name="**/*.gif"/>
<include name="**/*.GIF"/>
</patternset>
</unzip>
But this extracts contents from all the folders present in the zip file.
Wanted to know how to specify the folder name from which these gif files are
to be extracted.
Thanks,
Sunil
--
View this message in context: http://www.nabble.com/Unzip-specific-folders-in-ANT-tp21685421p21685761.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
AW: Unzip specific folders in ANT
Posted by Ja...@rzf.fin-nrw.de.
>I have a zip file with multiple folders in it.
>Instead of extracting the whole contents present in ZIP-File,
>is it possible
>to extract only the specific folders that is required for me?
Have a look at the examples of <unzip>.
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org