URL Connection Class



URL Connection Class

The URLConnection class provides a more granular interface to a URL than the getContent method in the URL class. This class provides method for examining HTTP headers, getting information about the URL’s content, and getting input and output stream to the URL.

Some of the methods used in these URL Connection Class are as follows

public abstract class java.net.URLConnection extends java.lang.Object {
protected java.net.URL url;
protected boolean doInput;
protected boolean doOutput;
protected boolean allowUserInteraction;
protected boolean useCaches;
protected long ifModifiedSinces;
protected boolean connected;
static java.net.ContentHandlerFactory factory;
public static synchronized java.net.FileNameMap getFileNameMap();
public static void setFileNameMap(java.net.FileNameMap);
public abstract void connect() throws java.io.IOException;
protected java.net.URLConnection(java.net.URL);
public java.net.URL getURL();
public int getContentLength();
public java.lang.String getContentType();
public java.lang.String getContentEncoding();
public long getExpiration();
public long getDate();
public long getLastModified();
public java.lang.String getHeaderField(java.lang.String);
public java.util.Map getHeaderFields();
public int getHeaderFiledInt(java.lang.String,int);
public long getHeaderFieldDate(java.lang.String,long);
public java.lang.String getHeaaderFieldKey(int);

Random Posts

  • Difference between getCurrentSession() and openSession()
  • Java Swings Interview Questions
  • Difference between errortag and message tag
  • Can we call destroy() method on servlets from service method
  • What are synchronized methods and synchronized statements?

Post a Comment