Class InputValidator

java.lang.Object
com.github.natche.gravatarjavaclient.utils.InputValidator

public final class InputValidator extends Object
A string validator used for validating parameter inputs.
  • Constructor Details

    • InputValidator

      public InputValidator()
  • Method Details

    • isValidEmailAddress

      public static boolean isValidEmailAddress(String input)
      Returns whether the provided input is a valid email address. Note, this does not check for existence, merely proper syntactical structure.
      Parameters:
      input - the input
      Returns:
      whether the encapsulated input is a valid email address
    • isValidImageUrl

      public static boolean isValidImageUrl(String input)
      Returns whether the provided input is a valid image URL. See ImageIO.read(URL) for more information.
      Parameters:
      input - the input
      Returns:
      whether the encapsulated input is a valid image URL
    • isValidFilename

      public static boolean isValidFilename(String input)
      Returns whether the provided input is a valid filename for this operating system.
      Parameters:
      input - the input to use as a filename
      Returns:
      whether the provided filename is valid for this operating system
      Throws:
      NullPointerException - if the provided filename is null
      IllegalArgumentException - if the provided filename is empty