MalformedURLException

  • MalformedURLException signals an issue with a URL, such as an invalid protocol or parsing errors.

  • It's a subclass of IOException and offers constructors with and without detailed error messages.

  • You can create a MalformedURLException with no detail message or with a specific message explaining the issue.

  • This exception is typically thrown when a URL is improperly formatted or contains invalid characters, hindering its successful parsing.

public class MalformedURLException extends IOException

Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a specification string or the string could not be parsed.

Public Constructor Summary

MalformedURLException()
Constructs a MalformedURLException with no detail message.
MalformedURLException(String msg)
Constructs a MalformedURLException with the specified detail message.

Inherited Method Summary

Public Constructors

public MalformedURLException ()

Constructs a MalformedURLException with no detail message.

public MalformedURLException (String msg)

Constructs a MalformedURLException with the specified detail message.

Parameters
msg the detail message.