FileDocCategorySizeDatePackage
BaseTask.javaAPI DocApache Ant 1.702617Wed Dec 13 06:16:20 GMT 2006task

BaseTask

public abstract class BaseTask extends org.apache.tools.ant.Task
Base class for the uuencode/decode test tasks.

Fields Summary
private static final org.apache.tools.ant.util.FileUtils
FILE_UTILS
private File
inFile
private File
outFile
Constructors Summary
Methods Summary
private voidassertAttribute(java.io.File file, java.lang.String attributeName)

        if (file == null) {
            throw new BuildException("Required attribute " + attributeName
                                     + " not set");
        }
    
protected abstract voiddoit(java.io.InputStream is, java.io.OutputStream os)

public voidexecute()

        assertAttribute(inFile, "inFile");
        assertAttribute(outFile, "outFile");
        InputStream inputStream = null;
        OutputStream outputStream = null;
        try {
            inputStream = new BufferedInputStream(
                new FileInputStream(getInFile()));
            outputStream = new FileOutputStream(getOutFile());
            doit(inputStream, outputStream);
        } catch (Exception ex) {
            throw new BuildException(ex);
        } finally {
            FILE_UTILS.close(inputStream);
            FILE_UTILS.close(outputStream);
        }
    
protected java.io.FilegetInFile()

        return inFile;
    
protected java.io.FilegetOutFile()

        return outFile;
    
public voidsetInFile(java.io.File inFile)


        
        this.inFile = inFile;
    
public voidsetOutFile(java.io.File outFile)

        this.outFile = outFile;