class PDFToTextTask extends Task
{
    private final List<FileSet> fileSets = new ArrayList<>();

    /**
     * Adds a set of files (nested fileset attribute).
     *
     * @param set Another fileset to add.
     */
    public void addFileset( FileSet set )
    {
        fileSets.add( set );
    }

    /**
     * This will perform the execution.
     */
    @Override
    public void execute()
    {<FILL_FUNCTION_BODY>}
}

        log( "PDFToTextTask executing" );

        fileSets.stream().
            map(fileSet -> fileSet.getDirectoryScanner(getProject())).
            forEachOrdered(dirScanner ->
            {
                dirScanner.scan();
                for (String file : dirScanner.getIncludedFiles())
                {
                    File f = new File(dirScanner.getBasedir(), file);
                    log("processing: " + f.getAbsolutePath());
                    String pdfFile = f.getAbsolutePath();
                    if (pdfFile.toUpperCase().endsWith(".PDF"))
                    {
                        String textFile = pdfFile.substring(0, pdfFile.length() - 3) + "txt";
                        ExtractText.main(new String[] {pdfFile, textFile});
                    }
                }
            });
    
<no_super_class>