## Deprecated API

Contents

- Deprecated Classes
- Deprecated Fields
- Deprecated Methods
- Deprecated Constructors

Deprecated Classes
org.apache.tools.ant.loader.AntClassLoader2 since 1.7 Just use `AntClassLoader` itself.
org.apache.tools.ant.taskdefs.Copydir The copydir task is deprecated since Ant 1.2. Use copy instead.
org.apache.tools.ant.taskdefs.Copyfile The copyfile task is deprecated since Ant 1.2. Use copy instead.
org.apache.tools.ant.taskdefs.Deltree The deltree task is deprecated since Ant 1.2. Use delete instead.
org.apache.tools.ant.taskdefs.Exec since 1.2. delegate to `Execute` instead.
org.apache.tools.ant.taskdefs.FixCRLF.OneLiner since 1.7.0.
org.apache.tools.ant.taskdefs.Jikes since 1.2. Merged into the class Javac.
org.apache.tools.ant.taskdefs.JikesOutputParser since 1.2. Use Jikes' exit value to detect compilation failure.
org.apache.tools.ant.taskdefs.KeySubst KeySubst is deprecated since Ant 1.1. Use Filter + Copy instead.
org.apache.tools.ant.taskdefs.optional.net.MimeMail since 1.6.x. Use `EmailTask` instead.
org.apache.tools.ant.taskdefs.Rename The rename task is deprecated since Ant 1.2. Use move instead.
org.apache.tools.ant.taskdefs.optional.RenameExtensions since 1.5.x. Use <move> instead
org.apache.tools.ant.util.ScriptRunner Implementation moved to another location. Use that org.apache.tools.ant.types.optional.ScriptRunner instead.
org.apache.tools.ant.taskdefs.optional.StyleBook since 1.7. This task is considered unsupported by the Ant developers
org.apache.tools.ant.taskdefs.TaskOutputStream since 1.2.x. Use LogOutputStream instead.
org.apache.tools.ant.util.WeakishReference deprecated 1.7; will be removed in Ant1.8 Just use `WeakReference` directly.
org.apache.tools.ant.util.WeakishReference.HardReference since 1.7. Hopefully nobody is using this.
org.apache.tools.ant.util.optional.WeakishReference12 since 1.7. Just use `WeakReference` directly. Note that in ant1.7 is parent was changed to extend HardReference. This is because the latter has access to the (package scoped) WeakishReference(Object) constructor, and both that and this are thin facades on the underlying no-longer-abstract base class.
org.apache.tools.ant.taskdefs.optional.junit.Xalan2Executor since Ant 1.7

Deprecated Fields
org.apache.tools.ant.types.DataType.checked since 1.7. The user should not be directly referencing variable. Please use `DataType.setChecked(boolean)` or `DataType.isChecked()` instead.
org.apache.tools.ant.DirectoryScanner.DEFAULTEXCLUDES since 1.6.x. Use the `getDefaultExcludes` method instead.
org.apache.tools.ant.ProjectComponent.description since 1.6.x. You should not be accessing this variable directly.
org.apache.tools.ant.taskdefs.Tar.FAIL since 1.5.x. Tar.FAIL is deprecated and is replaced with Tar.TarLongFileMode.FAIL
org.apache.tools.ant.taskdefs.Tar.GNU since 1.5.x. Tar.GNU is deprecated and is replaced with Tar.TarLongFileMode.GNU
org.apache.tools.ant.Project.JAVA_1_0 since 1.5.x. Use `JavaEnvUtils.JAVA_1_0` instead.
org.apache.tools.ant.Project.JAVA_1_1 since 1.5.x. Use `JavaEnvUtils.JAVA_1_1` instead.
org.apache.tools.ant.Project.JAVA_1_2 since 1.5.x. Use `JavaEnvUtils.JAVA_1_2` instead.
org.apache.tools.ant.Project.JAVA_1_3 since 1.5.x. Use `JavaEnvUtils.JAVA_1_3` instead.
org.apache.tools.ant.Project.JAVA_1_4 since 1.5.x. Use `JavaEnvUtils.JAVA_1_4` instead.
org.apache.tools.ant.ProjectComponent.location since 1.6.x. You should not be accessing this variable directly. Please use the `ProjectComponent.getLocation()` method.
org.apache.tools.ant.taskdefs.Tar.OMIT since 1.5.x. Tar.OMIT is deprecated and is replaced with Tar.TarLongFileMode.OMIT
org.apache.tools.ant.ProjectComponent.project since 1.6.x. You should not be directly accessing this variable directly. You should access project object via the getProject() or setProject() accessor/mutators.
org.apache.tools.ant.types.DataType.ref since 1.7. The user should not be directly referencing variable. Please use `DataType.getRefid()` instead.
org.apache.tools.ant.Task.target since 1.6.x. You should not be accessing this variable directly. Please use the `Task.getOwningTarget()` method.
org.apache.tools.ant.Task.taskName since 1.6.x. You should not be accessing this variable directly. Please use the `Task.getTaskName()` method.
org.apache.tools.ant.Task.taskType since 1.6.x. You should not be accessing this variable directly. Please use the `Task.getTaskType()` method.
org.apache.tools.ant.taskdefs.Tar.TRUNCATE since 1.5.x. Tar.TRUNCATE is deprecated and is replaced with Tar.TarLongFileMode.TRUNCATE
org.apache.tools.ant.taskdefs.Tar.WARN since 1.5.x. Tar.WARN is deprecated and is replaced with Tar.TarLongFileMode.WARN
org.apache.tools.ant.Task.wrapper since 1.6.x. You should not be accessing this variable directly. Please use the `Task.getWrapper()` method.

Deprecated Methods
org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.addExtdirsToClasspath(Path) since 1.5.x. Use org.apache.tools.ant.types.Path#addExtdirs instead.
org.apache.tools.ant.Project.addFilter(String, String) since 1.4.x. Use getGlobalFilterSet().addFilter(token,value)
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.addSysproperty(Environment.Variable) since ant 1.6
org.apache.tools.ant.taskdefs.Tar.archiveIsUpToDate(String[]) since 1.5.x. use the two-arg version instead.
org.apache.tools.ant.ProjectHelper.configure(Object, AttributeList, Project) since 1.6.x. Use IntrospectionHelper for each property.
org.apache.tools.ant.taskdefs.XSLTProcess.configureLiaison(File) since Ant 1.7
org.apache.tools.ant.Project.copyFile(File, File) since 1.4.x
org.apache.tools.ant.Project.copyFile(File, File, boolean) since 1.4.x
org.apache.tools.ant.Project.copyFile(File, File, boolean, boolean) since 1.4.x
org.apache.tools.ant.Project.copyFile(File, File, boolean, boolean, boolean) since 1.4.x
org.apache.tools.ant.Project.copyFile(String, String) since 1.4.x
org.apache.tools.ant.Project.copyFile(String, String, boolean) since 1.4.x
org.apache.tools.ant.Project.copyFile(String, String, boolean, boolean) since 1.4.x
org.apache.tools.ant.Project.copyFile(String, String, boolean, boolean, boolean) since 1.4.x
org.apache.tools.ant.taskdefs.MacroInstance.createDynamicElement(String) since 1.6.x.
org.apache.tools.ant.IntrospectionHelper.createElement(Project, Object, String) since 1.6.x. This is not a namespace aware method.
org.apache.tools.ant.taskdefs.optional.jdepend.JDependTask.createSourcespath() since 1.6.x.
org.apache.tools.ant.util.CollectionUtils.equals(Dictionary, Dictionary) since 1.6.x.
org.apache.tools.ant.util.CollectionUtils.equals(Vector, Vector) since 1.6.x.
org.apache.tools.ant.taskdefs.optional.script.ScriptDef.executeScript(Map, Map) since 1.7. Use executeScript(attribute, elements, instance) instead.
org.apache.tools.ant.RuntimeConfigurable.getAttributes() Deprecated since Ant 1.6 in favor of `RuntimeConfigurable.getAttributeMap()`.
org.apache.tools.ant.ProjectHelper.getContextClassLoader() since 1.6.x. Use LoaderUtils.getContextClassLoader()
org.apache.tools.ant.types.ArchiveFileSet.getDirMode() since 1.7.
org.apache.tools.ant.types.ArchiveFileSet.getFileMode() since 1.7.
org.apache.tools.ant.Project.getFilters() since 1.4.x Use getGlobalFilterSet().getFilterHash().
org.apache.tools.ant.types.ArchiveFileSet.getFullpath() since 1.7.
org.apache.tools.ant.Project.getJavaVersion() since 1.5.x. Use org.apache.tools.ant.util.JavaEnvUtils instead.
org.apache.tools.ant.util.FileUtils.getParentFile(File) since 1.7. Just use `File.getParentFile()` directly.
org.apache.tools.ant.types.ArchiveFileSet.getPrefix() since 1.7.
org.apache.tools.ant.taskdefs.optional.jdepend.JDependTask.getSourcespath() since 1.6.x.
org.apache.tools.ant.taskdefs.optional.TraXLiaison.getSystemId(File) since 1.5.x. Use org.apache.tools.ant.util.JAXPUtils#getSystemId instead.
org.apache.tools.ant.AntClassLoader.initializeClass(Class) since 1.6.x. Use Class.forName with initialize=true instead.
org.apache.tools.ant.util.FileUtils.newFileUtils() since 1.7. Use getFileUtils instead, FileUtils do not have state.
org.apache.tools.ant.ProjectHelper.parsePropertyString(String, Vector, Vector) since 1.6.x. Use PropertyHelper.
org.apache.tools.ant.taskdefs.SQLExec.printResults(PrintStream) since 1.6.x. Use `the two arg version` instead.
org.apache.tools.ant.util.CollectionUtils.putAll(Dictionary, Dictionary) since 1.6.x.
org.apache.tools.ant.ProjectHelper.replaceProperties(Project, String) since 1.6.x. Use project.replaceProperties().
org.apache.tools.ant.ProjectHelper.replaceProperties(Project, String, Hashtable) since 1.6.x. Use PropertyHelper.
org.apache.tools.ant.Project.resolveFile(String, File) since 1.4.x
org.apache.tools.ant.taskdefs.optional.net.FTP.setAction(String) since 1.5.x. setAction(String) is deprecated and is replaced with setAction(FTP.Action) to make Ant's Introspection mechanism do the work and also to encapsulate operations on the type in its own class.
org.apache.tools.ant.RuntimeConfigurable.setAttributes(AttributeList) since 1.6.x.
org.apache.tools.ant.taskdefs.optional.ReplaceRegExp.setByLine(String) since 1.6.x. Use setByLine(boolean).
org.apache.tools.zip.ZipEntry.setComprSize(long) since 1.7. Use setCompressedSize directly.
org.apache.tools.ant.taskdefs.FixCRLF.setCr(FixCRLF.AddAsisRemove) since 1.4.x. Use `setEol` instead.
org.apache.tools.ant.Project.setDefaultTarget(String) since 1.5.x. Use setDefault.
org.apache.tools.ant.taskdefs.Unpack.setDest(String) since 1.5.x. setDest(String) is deprecated and is replaced with setDest(File) to make Ant's Introspection mechanism do the work and also to encapsulate operations on the type in its own class.
org.apache.tools.ant.taskdefs.Ear.setEarfile(File) since 1.5.x. Use setDestFile(destfile) instead.
org.apache.tools.ant.taskdefs.Javadoc.setExtdirs(String) since 1.5.x. Use the `Javadoc.setExtdirs(Path)` version.
org.apache.tools.ant.taskdefs.Zip.setFile(File) since 1.5.x. Use setDestFile(File) instead.
org.apache.tools.ant.Project.setFileLastModified(File, long) since 1.4.x
org.apache.tools.ant.taskdefs.optional.ANTLR.setGlib(String) since ant 1.6
org.apache.tools.ant.taskdefs.Jar.setJarfile(File) since 1.5.x. Use setDestFile(File) instead.
org.apache.tools.ant.taskdefs.Tar.setLongfile(String) since 1.5.x. setLongFile(String) is deprecated and is replaced with setLongFile(Tar.TarLongFileMode) to make Ant's Introspection mechanism do the work and also to encapsulate operations on the mode in its own class.
org.apache.tools.ant.taskdefs.SendEmail.setMailport(Integer) since 1.5.x. Use `EmailTask.setMailport(int)` instead.
org.apache.tools.ant.taskdefs.ExecuteJava.setOutput(PrintStream) since 1.4.x. manage output at the task level.
org.apache.tools.ant.taskdefs.Copy.setPreserveLastModified(String) since 1.5.x. setPreserveLastModified(String) has been deprecated and replaced with setPreserveLastModified(boolean) to consistently let the Introspection mechanism work.
org.apache.tools.ant.taskdefs.DefBase.setReverseLoader(boolean) since 1.6.x. stop using this attribute
org.apache.tools.ant.taskdefs.Unpack.setSrc(String) since 1.5.x. setSrc(String) is deprecated and is replaced with setSrc(File) to make Ant's Introspection mechanism do the work and also to encapsulate operations on the type in its own class.
org.apache.tools.ant.taskdefs.Tar.setTarfile(File) since 1.5.x. For consistency with other tasks, please use setDestFile().
org.apache.tools.ant.taskdefs.PathConvert.setTargetos(String) since 1.5.x. Use the method taking a TargetOs argument instead.
org.apache.tools.ant.taskdefs.Available.setType(String) since 1.5.x. setType(String) is deprecated and is replaced with setType(Available.FileDir) to make Ant's Introspection mechanism do the work and also to encapsulate operations on the type in its own class.
org.apache.tools.ant.taskdefs.Tstamp.CustomFormat.setUnit(String) since 1.5.x. setUnit(String) is deprecated and is replaced with setUnit(Tstamp.Unit) to make Ant's Introspection mechanism do the work and also to encapsulate operations on the unit in its own class.
org.apache.tools.ant.taskdefs.optional.splash.SplashTask.setUseproxy(boolean) since 1.5.x. Use org.apache.tools.ant.taskdefs.optional.SetProxy
org.apache.tools.ant.taskdefs.Property.setUserProperty(boolean) since 1.5.x. This was never a supported feature and has been deprecated without replacement.
org.apache.tools.ant.taskdefs.War.setWarfile(File) since 1.5.x. Use setDestFile(File) instead
org.apache.tools.ant.taskdefs.Zip.setZipfile(File) since 1.5.x. Use setDestFile(File) instead.
org.apache.tools.ant.types.CommandlineJava.size() since 1.7. Please dont use this, it effectively creates the entire command.
org.apache.tools.ant.taskdefs.Touch.touch(File) since 1.6.x.
org.apache.tools.ant.Project.translatePath(String) since 1.7 Use FileUtils.translatePath instead.

Deprecated Constructors
org.apache.tools.ant.taskdefs.ExecuteWatchdog(int) since 1.5.x. Use constructor with a long type instead. (1.4.x compatibility)
org.apache.tools.ant.Main(String[]) since 1.6.x
org.apache.tools.ant.types.Reference() since 1.7. Please use `Reference.Reference(Project,String)` instead.
org.apache.tools.ant.types.Reference(String) since 1.7. Please use `Reference.Reference(Project,String)` instead.