1 18 19 package org.apache.tools.ant.taskdefs; 20 21 import java.io.FileOutputStream ; 22 import java.io.IOException ; 23 import java.util.zip.GZIPOutputStream ; 24 import org.apache.tools.ant.BuildException; 25 import org.apache.tools.ant.util.FileUtils; 26 27 35 36 public class GZip extends Pack { 37 40 protected void pack() { 41 GZIPOutputStream zOut = null; 42 try { 43 zOut = new GZIPOutputStream (new FileOutputStream (zipFile)); 44 zipResource(getSrcResource(), zOut); 45 } catch (IOException ioe) { 46 String msg = "Problem creating gzip " + ioe.getMessage(); 47 throw new BuildException(msg, ioe, getLocation()); 48 } finally { 49 FileUtils.close(zOut); 50 } 51 } 52 53 64 protected boolean supportsNonFileResources() { 65 return getClass().equals(GZip.class); 66 } 67 } 68 | Popular Tags |