Jacson

de.spieleck.helper
Class PrefixZipTask

java.lang.Object
  extended byZip
      extended byde.spieleck.helper.PrefixZipTask

public class PrefixZipTask
extends 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="de.spieleck.helper.PrefixZipTask" name="xzip"
        classpath="${name}.jar" />
  <xzip zipfile="${release.zip}" globalprefix="${zip.prefix}/">
    <fileset refid="releaseFileset"/>
    <fileset refid="sampleFileset"/>
  </xzip>
 
with filesets instead of zipfilesets.

See Also:
Serialized Form

Field Summary
protected  java.lang.String globalPrefix
          Allow a global prefix for names within the Zipfile
 
Constructor Summary
PrefixZipTask()
           
 
Method Summary
 void reset()
           
 void setGlobalPrefix(java.lang.String globalPrefix)
          Allow a global prefix for names within the Zipfile
protected  void zipDir(java.io.File dir, ZipOutputStream zOut, java.lang.String vPath, int mode)
          Patch zipDir(), insert globalPrefix if appropriate.
protected  void zipFile(java.io.InputStream in, ZipOutputStream zOut, java.lang.String vPath, long lastModified, java.io.File fromArchive, int mode)
          Patch zipFile(), insert globalPrefix if appropriate.
protected  java.lang.String zipPath(java.lang.String vPath)
          Patch the path for inclusion in zipfile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

globalPrefix

protected java.lang.String globalPrefix
Allow a global prefix for names within the Zipfile

Constructor Detail

PrefixZipTask

public PrefixZipTask()
Method Detail

setGlobalPrefix

public void setGlobalPrefix(java.lang.String globalPrefix)
Allow a global prefix for names within the Zipfile

Parameters:
globalPrefix - the String to prefix all names.

zipPath

protected java.lang.String zipPath(java.lang.String vPath)
Patch the path for inclusion in zipfile.

Parameters:
vPath - the unpatched path
Returns:
the patched path

zipDir

protected void zipDir(java.io.File dir,
                      ZipOutputStream zOut,
                      java.lang.String vPath,
                      int mode)
               throws java.io.IOException
Patch zipDir(), insert globalPrefix if appropriate.

Throws:
java.io.IOException
Since:
patch

zipFile

protected void zipFile(java.io.InputStream in,
                       ZipOutputStream zOut,
                       java.lang.String vPath,
                       long lastModified,
                       java.io.File fromArchive,
                       int mode)
                throws java.io.IOException
Patch zipFile(), insert globalPrefix if appropriate.

Throws:
java.io.IOException
Since:
patch

reset

public void reset()
Since:
patch

Spieleck

Copyleft 2002 spieleck.de.