public UserAgentInfo parse ( String useragent ) throws IOException { UserAgentInfo retObj = new UserAgentInfo ( ) ; if ( useragent == null ) { return retObj ; } useragent = useragent . trim ( ) ; // check that the data maps are up-to-date checkDataMaps ( ) ; // first check if it's a robot if ( ! processRobot ( useragent , retObj ) ) { // search for a browser on the browser regex patterns boolean osFound = processBrowserRegex ( useragent , retObj ) ; if ( ! osFound ) { // search the OS regex patterns for the used OS processOsRegex ( useragent , retObj ) ; } } return retObj ; }
Parse the given user agent string and returns a UserAgentInfo object with the related data