URISyntaxException


URISyntaxException java.net

Java 1.4 serializable checked

Signals that a string could not be parsed as a valid URI. getInput( ) returns the string that could not be parsed. getreason( ) returns an error message. getIndex( ) returns the character position at which the syntax error occurred, if that information is available. getMessage( ) returns a human-readable string that includes the information from each of the other three methods .

This is a checked exception thrown by all the URI( ) constructors. If you are parsing a hard-coded URI that you do not believe to contain any syntax errors, and wish to avoid the checked exception, you can use the URI.create( ) factory method instead of the one-argument version of the URI( ) constructor .

Figure 12-26. java.net.URISyntaxException

 public class  URISyntaxException  extends Exception {  // Public Constructors  public  URISyntaxException  (String  input  , String  reason  );        public  URISyntaxException  (String  input  , String  reason  , int  index  );  // Public Instance Methods  public int  getIndex  ( );        public String  getInput  ( );        public String  getReason  ( );  // Public Methods Overriding Throwable  public String  getMessage  ( );   } 

Thrown By

URI.{parseServerAuthority( ) , URI( )} , URL.toURI( )



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net