URI GetSchemeSpecificPart() Example
Returns the decoded scheme-specific part of this URI.
URIclass GetSchemeSpecificPart() method example. This example shows you how to use GetSchemeSpecificPart() method.This methodReturns the decoded scheme-specific part of this URI.
Here is the code:-
/**
* @Program that Returns the decoded scheme-specific part of this URI.
* GetSchemeSpecificPart.java
* Author:-RoseIndia Team
* Date:-24-jun-2008
*/
import java.net.*;
public class GetSchemeSpecificPart {
public static void main(String[] args) throws Exception {
String scheme = "http";
String userInfo = "girish";
String host = "tewari.com";
int port = 8080;
String path = "/mail/";
String query = "open";
String fragment = "inbox";
URI uri = new URI(scheme, userInfo, host, port, path, query, fragment);
System.out.println("Given uri is: " + uri);
//Returns the decoded scheme-specific part of this URI.
System.out.println("Given scheme-specific part is: " + uri.getSchemeSpecificPart());
}
} |
Output of the program:-
Given uri is: http://girish@tewari.com:8080/mail/?open#inbox
Given scheme-specific part is: //girish@tewari.com:8080/mail/?open |
|