ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: Modify files inside zip
Date Fri, 17 Oct 2003 07:25:21 GMT
ZipFileSet overrides the getDirectoryScanner() method and returns a
ZipScanner
which itself (must be and) is a DirectoryScanner. Therefore other classes
shouldn´t
recognize that...

ZipFileSet extends FileSet and can therefore be used everywhere a FileSet
could 
(Java API). So the problem is introducing that into buildfile.

For a quick hack you could try to modify the
src/main/org/.../types/default.properties
and change
    fileset=org.apache.tools.ant.types.FileSet
to
    fileset=org.apache.tools.ant.types.ZipFileSet
(I think a <typedef> wouldn´t work because this file is evaluated before
<typedef>
statements.)
...


Maybe Antoine (co-author of ZipFileSet) can say something to this, if he has
time 
while being the build manager for Ant 1.6 :-)


Jan



> -----Original Message-----
> From: Patrick Martin [mailto:patrick.martin@sungard.com]
> Sent: Friday, October 17, 2003 9:12 AM
> To: 'Ant Users List'
> Subject: RE: Modify files inside zip
> 
> 
> And what about using zipfilesets inside tasks that currently 
> support only
> simple filesets as <copy>?
> 
> It seems to me that something like
> 
> <fileset zip="foo.zip">
>   <include name="**/bar/**"/>
> </fileset>
> 
> would be very similar to:
> 
> <zipfileset src="foo.zip">
>   <include name="**/bar/**"/>
> </zipfileset>
> 
> And as the class ZipFileSet extends Fileset, I wonder if it 
> would not be
> quite easy to do... I tried to have a look yesterday, but I 
> got lost after
> few classes...
> 
> Patrick
> 
> >  -----Original Message-----
> > From: 	Jan.Materne@rzf.fin-nrw.de@SUNGARD  
> > Sent:	vendredi 17 octobre 2003 09:04
> > To:	user@ant.apache.org
> > Subject:	RE: Modify files inside zip
> > 
> > Maybe that could be poss... mmh - big problem:
> > 
> > the handling of filesets via their api is:
> > - get the filesets DirectoryScanner
> > - ask the ds for selected files
> > - nested selectors may have access to the files content
> > - work with that files (relative to Filesets dir value)
> > 
> > Getting the names shouldn´t be the problem. But the 
> selection process
> > would be difficult
> > - extract the file
> > - let the selector check
> > and all without changing the uri of the file ... E.g. 
> <modified/> selector
> > uses the absolute path as key for storing the md5-hashvalue 
> of files.
> > 
> > 
> > The key is that another class must not recognize that the 
> files are inside
> > an
> > archive ...
> > 
> > (btw: <fileset zip="foo.zip"/> would be better. You could 
> have a directory
> > name
> > "foo.zip" ...)
> > 
> > 
> > 
> > Jan
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: Jing Xue [mailto:apache@magicfat.lunarpages.com
> > <mailto:apache@magicfat.lunarpages.com> ]
> > > Sent: Thursday, October 16, 2003 8:33 PM
> > > To: Ant Users List
> > > Subject: RE: Modify files inside zip
> > >
> > >
> > > Quoting Patrick Martin <patrick.martin@sungard.com>:
> > >
> > > > This idea is actually somewhat implemented in 
> zipfileset, isn't it?
> > >
> > > IIUC, zipfileset only allows to specify some extra attributes
> > > for a fileset
> > > within a 'zip' task. What I had in mind was something like:
> > >
> > > <fileset dir="foo.zip">  <!-- foo.zip is actually a zip file -->
> > >   <include name="**/bar/*"/>
> > > </fileset>
> > >
> > > And that can be used wherever a <fileset> or its descendant
> > > can be used.
> > > It may be more complicated than I thought, though.
> > >
> > > --J.X.
> > >
> > > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail: user-help@ant.apache.org
> > > 
> > 
> > 
> > 
> > 
> Confidentiality Notice: The information contained in this 
> e-mail message is
> intended only for the personal and confidential use of the 
> recipient(s)
> named above. If the reader of this message is not the 
> intended recipient or
> an agent responsible for delivering it to the intended 
> recipient, you are
> hereby notified that you have received this document in error 
> and that any
> review, dissemination, distribution, or copying of this 
> message is strictly
> prohibited. If you have received this communication in error, 
> please notify
> us immediately by e-mail, and delete the original message. 
> 
> Message confidentiel : Les informations contenues dans ce message sont
> destinées à un usage personnel et confidentiel du destinataire indiqué
> ci-dessus. Si le lecteur de ce message n'est pas le 
> destinataire prévu, ou
> n'est pas une personne en charge de le délivrer au 
> destinataire voulu, vous
> êtes par la présente informé que vous avez reçu ce document 
> par erreur, et
> que tout examen, transmission, distribution ou copie de ce message est
> totalement interdit. Si vous avez reçu cette communication 
> par erreur, nous
> vous remercions de bien vouloir nous avertir immédiatement 
> par e-mail et de
> détruire le message d'origine.
> 
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message