public static int vendorFromUri ( URI uri ) throws DataSourceResourceException { try { return Integer . parseInt ( uri . getAuthority ( ) , 16 ) ; } catch ( NumberFormatException e ) { throw new DataSourceResourceException ( "USB device must be of the format " + DEFAULT_USB_DEVICE_URI + " -- the given " + uri + " has a bad vendor ID" ) ; } }
Return an integer vendor ID from a URI specifying a USB device .