def METHOD_NAME(self, cmd, split=True, timeout=None, keep_rc=False, env=None, signum=None):
    tmp_cmd = cmd.strip().split()
    shell_cmd = tmp_cmd[0]
    arg = tmp_cmd[-1]
    if 'readlink' in shell_cmd:
        if arg == JAVA_PATH_1:
            return (0, [JAVA_PATH_2, ])
        elif arg == JAVA_PATH_ERR:
            return (1, ['file not found', ])
        elif arg.startswith('/'):
            return (0, [arg, ])
    elif 'rpm' in shell_cmd:
        if arg == JAVA_PATH_2:
            return (0, [JAVA_PKG_2, ])
        elif arg == HTTPD_PATH:
            return (0, [HTTPD_PKG, ])
        else:
            return (1, ['file {0} is not owned by any package'.format(arg), ])
    elif 'which' in shell_cmd:
        if 'exception' in arg:
            raise Exception()
        elif arg.startswith('/'):
            return [tmp_cmd[-1], ]
        elif arg.endswith('java'):
            return ['/usr/bin/java', ]
        elif arg.endswith('httpd'):
            return ['/usr/sbin/httpd', ]
    raise Exception()