if (log.isDebugEnabled()) { log.debug("Polling " + fileOrDirectory); } File[] files = null; if (fileOrDirectory.isDirectory()) { if (filter != null) { files = fileOrDirectory.listFiles(filter); } else { files = fileOrDirectory.listFiles(); } for (int i = 0; i < files.length; i++) { File aFile = files[i]; if (aFile.isDirectory()) { if (isRecursive()) { pollFileOrDirectory(aFile); } } else { pollFile(aFile); } } } else { pollFile(fileOrDirectory); }
pollFileOrDirectory(fileOrDirectory, true);
    protected void pollFileOrDirectory(File fileOrDirectory) throws WorkException {        if (log.isDebugEnabled()) {            log.debug("Polling " + fileOrDirectory);        }        File[] files = null;        if (fileOrDirectory.isDirectory()) {            if (filter != null) {                files = fileOrDirectory.listFiles(filter);            }            else {                files = fileOrDirectory.listFiles();            }            for (int i = 0; i < files.length; i++) {                File aFile = files[i];                if (aFile.isDirectory()) {                    if (isRecursive()) {                        pollFileOrDirectory(aFile);                    }                }                else {                    pollFile(aFile);                }            }        }        else {            pollFile(fileOrDirectory);        }    }