<bunzip2> and <gunzip> (bug 7552 audit). Fix documentation for <gzip> and <bzip2> - these tasks perform dependency checks. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272343 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -10,8 +10,8 @@ | |||||
| <h2><a name="pack">GZip/BZip2</a></h2> | <h2><a name="pack">GZip/BZip2</a></h2> | ||||
| <h3>Description</h3> | <h3>Description</h3> | ||||
| <p>Packs a file using the GZip or BZip2 algorithm. | <p>Packs a file using the GZip or BZip2 algorithm. | ||||
| These tasks do not do any dependency checking; the output file is | |||||
| always generated</p> | |||||
| The output file is only generated if it doesn't exist or the source | |||||
| file is newer.</p> | |||||
| <h3>Parameters</h3> | <h3>Parameters</h3> | ||||
| <table border="1" cellpadding="2" cellspacing="0"> | <table border="1" cellpadding="2" cellspacing="0"> | ||||
| <tr> | <tr> | ||||
| @@ -40,7 +40,7 @@ always generated</p> | |||||
| /></code></p> | /></code></p> | ||||
| </blockquote> | </blockquote> | ||||
| <hr> | <hr> | ||||
| <p align="center">Copyright © 2001 Apache Software Foundation. All rights | |||||
| <p align="center">Copyright © 2001-2002 Apache Software Foundation. All rights | |||||
| Reserved.</p> | Reserved.</p> | ||||
| </body> | </body> | ||||
| @@ -69,6 +69,8 @@ import org.apache.tools.bzip2.CBZip2InputStream; | |||||
| * | * | ||||
| * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | ||||
| * | * | ||||
| * @since Ant 1.5 | |||||
| * | |||||
| * @ant.task category="packaging" | * @ant.task category="packaging" | ||||
| */ | */ | ||||
| @@ -67,6 +67,8 @@ import org.apache.tools.bzip2.CBZip2OutputStream; | |||||
| * | * | ||||
| * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | ||||
| * | * | ||||
| * @since Ant 1.5 | |||||
| * | |||||
| * @ant.task category="packaging" | * @ant.task category="packaging" | ||||
| */ | */ | ||||
| @@ -67,6 +67,8 @@ import org.apache.tools.ant.Task; | |||||
| * Abstract Base class for pack tasks. | * Abstract Base class for pack tasks. | ||||
| * | * | ||||
| * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | ||||
| * | |||||
| * @since Ant 1.5 | |||||
| */ | */ | ||||
| public abstract class Pack extends Task { | public abstract class Pack extends Task { | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * The Apache Software License, Version 1.1 | * The Apache Software License, Version 1.1 | ||||
| * | * | ||||
| * Copyright (c) 2001 The Apache Software Foundation. All rights | |||||
| * Copyright (c) 2001-2002 The Apache Software Foundation. All rights | |||||
| * reserved. | * reserved. | ||||
| * | * | ||||
| * Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
| @@ -63,6 +63,8 @@ import org.apache.tools.ant.Task; | |||||
| * Abstract Base class for unpack tasks. | * Abstract Base class for unpack tasks. | ||||
| * | * | ||||
| * @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a> | * @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a> | ||||
| * | |||||
| * @since 1.5 | |||||
| */ | */ | ||||
| public abstract class Unpack extends Task { | public abstract class Unpack extends Task { | ||||
| @@ -139,8 +141,13 @@ public abstract class Unpack extends Task { | |||||
| } | } | ||||
| public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
| validate(); | |||||
| extract(); | |||||
| File savedDest = dest; // may be altered in validate | |||||
| try { | |||||
| validate(); | |||||
| extract(); | |||||
| } finally { | |||||
| dest = savedDest; | |||||
| } | |||||
| } | } | ||||
| protected abstract String getDefaultExtension(); | protected abstract String getDefaultExtension(); | ||||