Skip to content

Most visited

Recently visited

navigation
Added in API level 1

URISyntaxException

public class URISyntaxException
extends Exception

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.net.URISyntaxException


A URISyntaxException will be thrown if some information could not be parsed while creating a URI.

Summary

Public constructors

URISyntaxException(String input, String reason, int index)

Constructs a new URISyntaxException instance containing the string that caused the exception, a description of the problem and the index at which the error occurred.

URISyntaxException(String input, String reason)

Constructs a new URISyntaxException instance containing the string that caused the exception and a description of the problem.

Public methods

int getIndex()

Gets the index at which the syntax error was found or -1 if the index is unknown/unavailable.

String getInput()

Gets the initial string that contains an invalid syntax.

String getMessage()

Gets a description of the exception, including the reason, the string that caused the syntax error and the position of the syntax error if available.

String getReason()

Gets a description of the syntax error.

Inherited methods

From class java.lang.Throwable
From class java.lang.Object

Public constructors

URISyntaxException

Added in API level 1
URISyntaxException (String input, 
                String reason, 
                int index)

Constructs a new URISyntaxException instance containing the string that caused the exception, a description of the problem and the index at which the error occurred.

Parameters
input String: the string that caused the exception.
reason String: the reason why the exception occurred.
index int: the position where the exception occurred.
Throws
NullPointerException if one of the arguments input or reason is null.
IllegalArgumentException if the value for index is lesser than -1.

URISyntaxException

Added in API level 1
URISyntaxException (String input, 
                String reason)

Constructs a new URISyntaxException instance containing the string that caused the exception and a description of the problem.

Parameters
input String: the string that caused the exception.
reason String: the reason why the exception occurred.
Throws
NullPointerException if one of the arguments input or reason is null.

Public methods

getIndex

Added in API level 1
int getIndex ()

Gets the index at which the syntax error was found or -1 if the index is unknown/unavailable.

Returns
int the index of the syntax error.

getInput

Added in API level 1
String getInput ()

Gets the initial string that contains an invalid syntax.

Returns
String the string that caused the exception.

getMessage

Added in API level 1
String getMessage ()

Gets a description of the exception, including the reason, the string that caused the syntax error and the position of the syntax error if available.

Returns
String a sting containing information about the exception.

See also:

getReason

Added in API level 1
String getReason ()

Gets a description of the syntax error.

Returns
String the string describing the syntax error.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.