private File scanDirectoryForExecutable(File directory, String fileName) {
        boolean caseSensitive = Enigma.isFileSystemCaseSensitive(directory);
        String fileNameDot = fileName + ".";
        File[] files = directory.listFiles();
        if (files != null) {
            for (int i = 0; i < files.length; i++) {
                if (!files[i].isFile())
                    continue;
                String name = files[i].getName();
                if (!caseSensitive)
                    name = name.toLowerCase();
                if (name.equals(fileName) || name.startsWith(fileNameDot)) {
                    if (getInvokerFor(files[i]) != null)
                        return files[i];
                }
            }
        }
        return null;
    }