All About Class URLStreamHandler in Java

0
19
Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share


The abstract class URLStreamHandler is the common super class for all stream protocol handlers.A stream protocol handler knows how to make a connection for a particular protocol type such as ftp,http,gopher etc.

The class structure of URLStreamHandler is given as:


public abstract class java.net.URLStreamHandler extends java.lang.Object{
//constructor
public URLStreamHandler();
//default constructor
//methods
protected abstract URLConnection OpenConnection(URL url);
//opens a connection to the object referenced by the URL argument.it returns an URLConnection object
//for the URL.it throws IOException if an I/O error occurs while opening the connection.
protected void parseURL(URL url,String spec,int start,int limit);
//parses the string representation of a URL into an URL object.Limit-the character position to stop 
//parsing at.This is the end of th string or the position of the # character if present.
protected void setURL(URL url,String protocol,String host,int port,String file,String ref);
//sets the fileds of the URL argument to the indicated value.
protected String toExternalForm(URL url);
//converts a URL of a specific protocol to a String.
}
 
Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

LEAVE A REPLY

Please enter your comment!
Please enter your name here