def METHOD_NAME(path):
    java_files = []
    if os.path.isfile(path):
        if path.endswith(".java"):
            java_files.append(path)
    elif os.path.isdir(path):
        if config['recursive']:
            for dir, dirs, files in os.walk(path):
                for file in files:
                    if file.endswith(".java"):
                        pathname = os.path.join(dir,file)
                        java_files.append(pathname)
        else:
            print path
            for file in os.listdir(path):
                print file
                if file.endswith(".java"):
                    pathname = os.path.join(path,file)
                    java_files.append(pathname)
    return java_files