Method Summary |
|
public void | addRequestProperty(String field, String newValue) Adds the given request property. |
abstract public void | connect() Establishes the connection to the resource specified by this
URL with this method , along with other
options that can only be set before this connection is made. |
public boolean | getAllowUserInteraction() |
public int | getConnectTimeout() |
public Object | getContent() Answers the object pointed to by this URL . |
public Object | getContent(Class[] types) Answers the object pointed to by this URL . |
public String | getContentEncoding() Answers the Content encoding type of the response body, null if no such
field is found in the header response. |
public int | getContentLength() Answers the length of the content or body in the response header in
bytes. |
public String | getContentType() Answers the type of the content. |
public long | getDate() Answers the date in milliseconds since epoch when this response header
was created, or 0 if the field Date is not found in the
header. |
public static boolean | getDefaultAllowUserInteraction() Answers whether this connection allow user interaction by default. |
public static String | getDefaultRequestProperty(String field) Answers the default value for the field specified by field ,
null if there's no such field. |
public boolean | getDefaultUseCaches() Answers whether this connection use caches by default. |
public boolean | getDoInput() Answers whether this connection supports input. |
public boolean | getDoOutput() Answers whether this connection supports output. |
public long | getExpiration() Answers the date in milliseconds since epoch when this response header
expires or 0 if the field Expires is not found in the
header. |
public static FileNameMap | getFileNameMap() Answers the MIME table of this URL connection. |
public String | getHeaderField(int pos) Answers the value of the field at position pos. |
public String | getHeaderField(String key) Answers the value of the field corresponding to the key
Answers null if there is no such field. |
public long | getHeaderFieldDate(String field, long defaultValue) Answers the date value in the form of milliseconds since epoch
corresponding to the field field . |
public int | getHeaderFieldInt(String field, int defaultValue) Answers the integer value of the specified field. |
public String | getHeaderFieldKey(int posn) Answers the name of the field at position specified by posn ,
null if there are fewer than posn fields. |
public Map<String, List<String>> | getHeaderFields() Provides an unmodifiable map of the connection header values. |
public long | getIfModifiedSince() |
public InputStream | getInputStream() Creates an InputStream for reading from this URL Connection. |
public long | getLastModified() |
public OutputStream | getOutputStream() Creates an OutputStream for writing to this URL Connection. |
public java.security.Permission | getPermission() Answers the permissions necessary to make the connection. |
public int | getReadTimeout() |
public Map<String, List<String>> | getRequestProperties() Provides an unmodifiable map of the request properties. |
public String | getRequestProperty(String field) Answers the value corresponding to the field in the request Header, null
if no such field exists. |
public URL | getURL() |
public boolean | getUseCaches() |
public static String | guessContentTypeFromName(String url) Determines the MIME type of the file specified by the
string URL, using the filename extension. |
public static String | guessContentTypeFromStream(InputStream is) Examines the bytes of the input stream and returns the MIME type, null if
no content type can be deduced. |
public void | setAllowUserInteraction(boolean newValue) Sets the flag indicating whether this connection allows user interaction
This can only be called prior to connection establishment. |
public void | setConnectTimeout(int timeout) Sets a timeout for connection to perform non-block. |
public static synchronized void | setContentHandlerFactory(ContentHandlerFactory contentFactory) Sets the current content handler factory to be
contentFactory . |
public static void | setDefaultAllowUserInteraction(boolean allows) Set whether user interaction is allowed by default. |
public static void | setDefaultRequestProperty(String field, String value) |
public void | setDefaultUseCaches(boolean newValue) Set whether caches are used by default. |
public void | setDoInput(boolean newValue) Sets whether this URLConnection allows input. |
public void | setDoOutput(boolean newValue) Sets whether this URLConnection allows output. |
public static void | setFileNameMap(FileNameMap map) With permission from the security manager, this method sets the
map to be the MIME Table of this URL connection. |
public void | setIfModifiedSince(long newValue) Sets the header field ifModifiedSince . |
public void | setReadTimeout(int timeout) Sets a timeout for reading to perform non-block. |
public void | setRequestProperty(String field, String newValue) Sets the value of the request header field field to
newValue Only the current URL Connection is affected. |
public void | setUseCaches(boolean newValue) Sets the flag indicating if this connection uses caches. |
public String | toString() |