Class DefaultNative2Ascii
java.lang.Object
org.apache.tools.ant.taskdefs.optional.native2ascii.DefaultNative2Ascii
- All Implemented Interfaces:
Native2AsciiAdapter
- Direct Known Subclasses:
KaffeNative2Ascii
,SunNative2Ascii
public abstract class DefaultNative2Ascii extends java.lang.Object implements Native2AsciiAdapter
encapsulates the handling common to different Native2AsciiAdapter
implementations.
- Since:
- Ant 1.6.3
-
Constructor Summary
Constructors Constructor Description DefaultNative2Ascii()
No-arg constructor. -
Method Summary
Modifier and Type Method Description protected void
addFiles(Commandline cmd, ProjectComponent log, java.io.File src, java.io.File dest)
Adds source and dest files to the command line.boolean
convert(Native2Ascii args, java.io.File srcFile, java.io.File destFile)
Splits the task into setting up the command line switchesprotected abstract boolean
run(Commandline cmd, ProjectComponent log)
Executes the command.protected void
setup(Commandline cmd, Native2Ascii args)
Sets up the initial command line.
-
Constructor Details
-
DefaultNative2Ascii
public DefaultNative2Ascii()No-arg constructor.
-
-
Method Details
-
convert
public final boolean convert(Native2Ascii args, java.io.File srcFile, java.io.File destFile) throws BuildExceptionSplits the task into setting up the command line switches- Specified by:
convert
in interfaceNative2AsciiAdapter
- Parameters:
args
- the native 2 ascii arguments.srcFile
- the source file.destFile
- the destination file.- Returns:
- run if the conversion was successful.
- Throws:
BuildException
- if there is a problem. (delegated tosetup
), adding the file names (delegated toaddFiles
) and running the tool (delegated torun
).
-
setup
Sets up the initial command line.only the -encoding argument and nested arg elements get handled here.
- Parameters:
cmd
- Command line to add toargs
- provides the user-setting and access to Ant's logging system.- Throws:
BuildException
- if there was a problem.
-
addFiles
protected void addFiles(Commandline cmd, ProjectComponent log, java.io.File src, java.io.File dest) throws BuildExceptionAdds source and dest files to the command line.This implementation adds them without any leading qualifiers, source first.
- Parameters:
cmd
- Command line to add tolog
- provides access to Ant's logging system.src
- the source filedest
- the destination file- Throws:
BuildException
- if there was a problem.
-
run
Executes the command.- Parameters:
cmd
- Command line to executelog
- provides access to Ant's logging system.- Returns:
- whether execution was successful
- Throws:
BuildException
- if there was a problem.
-