diff --git a/src/main/org/apache/tools/ant/taskdefs/Expand.java b/src/main/org/apache/tools/ant/taskdefs/Expand.java index aa57176ae..8fe44dd4d 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Expand.java +++ b/src/main/org/apache/tools/ant/taskdefs/Expand.java @@ -439,12 +439,30 @@ public class Expand extends Task { * @since Ant 1.6 */ public void setEncoding(String encoding) { + internalSetEncoding(encoding); + } + + /** + * Supports grand-children that want to support the attribute + * where the child-class doesn't (i.e. Unzip in the compress + * Antlib). + * + * @since Ant 1.8.0 + */ + protected void internalSetEncoding(String encoding) { if (NATIVE_ENCODING.equals(encoding)) { encoding = null; } this.encoding = encoding; } + /** + * @since Ant 1.8.0 + */ + public String getEncoding() { + return encoding; + } + /** * Whether leading path separators should be stripped. * @@ -460,6 +478,25 @@ public class Expand extends Task { * @since Ant 1.8.0 */ public void setScanForUnicodeExtraFields(boolean b) { + internalSetScanForUnicodeExtraFields(b); + } + + /** + * Supports grand-children that want to support the attribute + * where the child-class doesn't (i.e. Unzip in the compress + * Antlib). + * + * @since Ant 1.8.0 + */ + protected void internalSetScanForUnicodeExtraFields(boolean b) { scanForUnicodeExtraFields = b; } + + /** + * @since Ant 1.8.0 + */ + public boolean getScanForUnicodeExtraFields() { + return scanForUnicodeExtraFields; + } + } diff --git a/src/main/org/apache/tools/ant/taskdefs/Untar.java b/src/main/org/apache/tools/ant/taskdefs/Untar.java index b07caf768..5e033f7fb 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Untar.java +++ b/src/main/org/apache/tools/ant/taskdefs/Untar.java @@ -42,7 +42,7 @@ import org.apache.tools.tar.TarInputStream; *

PatternSets are used to select files to extract * from the archive. If no patternset is used, all files are extracted. *

- *

FileSet>s may be used to select archived files + *

FileSets may be used to select archived files * to perform unarchival upon. *

*

File permissions will not be restored on extracted files.

@@ -86,6 +86,17 @@ public class Untar extends Expand { + " attribute", getLocation()); } + /** + * No unicode extra fields in tar. + * + * @since Ant 1.8.0 + */ + public void setScanForUnicodeExtraFields(boolean b) { + throw new BuildException("The " + getTaskName() + + " task doesn't support the encoding" + + " attribute", getLocation()); + } + /** * @see Expand#expandFile(FileUtils, File, File) */