Class URIResultParser

java.lang.Object
com.google.zxing.client.result.ResultParser
com.google.zxing.client.result.URIResultParser

public final class URIResultParser extends ResultParser
Tries to parse results that are a URI of some kind.
  • Field Details

    • ALLOWED_URI_CHARS_PATTERN

      private static final Pattern ALLOWED_URI_CHARS_PATTERN
    • USER_IN_HOST

      private static final Pattern USER_IN_HOST
    • URL_WITH_PROTOCOL_PATTERN

      private static final Pattern URL_WITH_PROTOCOL_PATTERN
    • URL_WITHOUT_PROTOCOL_PATTERN

      private static final Pattern URL_WITHOUT_PROTOCOL_PATTERN
  • Constructor Details

    • URIResultParser

      public URIResultParser()
  • Method Details

    • parse

      public URIParsedResult parse(Result result)
      Description copied from class: ResultParser
      Attempts to parse the raw Result's contents as a particular type of information (email, URL, etc.) and return a ParsedResult encapsulating the result of parsing.
      Specified by:
      parse in class ResultParser
      Parameters:
      result - the raw Result to parse
      Returns:
      ParsedResult encapsulating the parsing result
    • isPossiblyMaliciousURI

      static boolean isPossiblyMaliciousURI(String uri)
      Returns:
      true if the URI contains suspicious patterns that may suggest it intends to mislead the user about its true nature. At the moment this looks for the presence of user/password syntax in the host/authority portion of a URI which may be used in attempts to make the URI's host appear to be other than it is. Example: http://yourbank.com@phisher.com This URI connects to phisher.com but may appear to connect to yourbank.com at first glance.
    • isBasicallyValidURI

      static boolean isBasicallyValidURI(String uri)