void
|
addRequestProperty(String key, String value)
Adds a general request property specified by a
key-value pair.
|
abstract
void
|
connect()
Opens a communications link to the resource referenced by this
URL, if such a connection has not already been established.
|
boolean
|
getAllowUserInteraction()
Returns the value of the allowUserInteraction field for
this object.
|
int
|
getConnectTimeout()
Returns setting for connect timeout.
|
Object
|
getContent()
Retrieves the contents of this URL connection.
|
Object
|
getContent(Class[] classes)
Retrieves the contents of this URL connection.
|
String
|
getContentEncoding()
Returns the value of the content-encoding header field.
|
int
|
getContentLength()
Returns the value of the content-length header field.
|
String
|
getContentType()
Returns the value of the content-type header field.
|
long
|
getDate()
Returns the value of the date header field.
|
static
boolean
|
getDefaultAllowUserInteraction()
Returns the default value of the allowUserInteraction
field.
|
static
String
|
getDefaultRequestProperty(String key)
This method is deprecated.
The instance specific getRequestProperty method
should be used after an appropriate instance of URLConnection
is obtained.
|
boolean
|
getDefaultUseCaches()
Returns the default value of a URLConnection 's
useCaches flag.
|
boolean
|
getDoInput()
Returns the value of this URLConnection 's
doInput flag.
|
boolean
|
getDoOutput()
Returns the value of this URLConnection 's
doOutput flag.
|
long
|
getExpiration()
Returns the value of the expires header field.
|
synchronized
static
FileNameMap
|
getFileNameMap()
Loads filename map (a mimetable) from a data file.
|
String
|
getHeaderField(String name)
Returns the value of the named header field.
|
String
|
getHeaderField(int n)
Returns the value for the n th header field.
|
long
|
getHeaderFieldDate(String name, long Default)
Returns the value of the named field parsed as date.
|
int
|
getHeaderFieldInt(String name, int Default)
Returns the value of the named field parsed as a number.
|
String
|
getHeaderFieldKey(int n)
Returns the key for the n th header field.
|
Map<String, List<String>>
|
getHeaderFields()
Returns an unmodifiable Map of the header fields.
|
long
|
getIfModifiedSince()
Returns the value of this object's ifModifiedSince field.
|
InputStream
|
getInputStream()
Returns an input stream that reads from this open connection.
|
long
|
getLastModified()
Returns the value of the last-modified header field.
|
OutputStream
|
getOutputStream()
Returns an output stream that writes to this connection.
|
Permission
|
getPermission()
Returns a permission object representing the permission
necessary to make the connection represented by this
object.
|
int
|
getReadTimeout()
Returns setting for read timeout.
|
Map<String, List<String>>
|
getRequestProperties()
Returns an unmodifiable Map of general request
properties for this connection.
|
String
|
getRequestProperty(String key)
Returns the value of the named general request property for this
connection.
|
URL
|
getURL()
Returns the value of this URLConnection 's URL
field.
|
boolean
|
getUseCaches()
Returns the value of this URLConnection 's
useCaches field.
|
static
String
|
guessContentTypeFromName(String fname)
Tries to determine the content type of an object, based
on the specified "file" component of a URL.
|
static
String
|
guessContentTypeFromStream(InputStream is)
Tries to determine the type of an input stream based on the
characters at the beginning of the input stream.
|
void
|
setAllowUserInteraction(boolean allowuserinteraction)
Set the value of the allowUserInteraction field of
this URLConnection .
|
void
|
setConnectTimeout(int timeout)
Sets a specified timeout value, in milliseconds, to be used
when opening a communications link to the resource referenced
by this URLConnection.
|
synchronized
static
void
|
setContentHandlerFactory(ContentHandlerFactory fac)
Sets the ContentHandlerFactory of an
application.
|
static
void
|
setDefaultAllowUserInteraction(boolean defaultallowuserinteraction)
Sets the default value of the
allowUserInteraction field for all future
URLConnection objects to the specified value.
|
static
void
|
setDefaultRequestProperty(String key, String value)
This method is deprecated.
The instance specific setRequestProperty method
should be used after an appropriate instance of URLConnection
is obtained. Invoking this method will have no effect.
|
void
|
setDefaultUseCaches(boolean defaultusecaches)
Sets the default value of the useCaches field to the
specified value.
|
void
|
setDoInput(boolean doinput)
Sets the value of the doInput field for this
URLConnection to the specified value.
|
void
|
setDoOutput(boolean dooutput)
Sets the value of the doOutput field for this
URLConnection to the specified value.
|
static
void
|
setFileNameMap(FileNameMap map)
Sets the FileNameMap.
|
void
|
setIfModifiedSince(long ifmodifiedsince)
Sets the value of the ifModifiedSince field of
this URLConnection to the specified value.
|
void
|
setReadTimeout(int timeout)
Sets the read timeout to a specified timeout, in
milliseconds.
|
void
|
setRequestProperty(String key, String value)
Sets the general request property.
|
void
|
setUseCaches(boolean usecaches)
Sets the value of the useCaches field of this
URLConnection to the specified value.
|
String
|
toString()
Returns a String representation of this URL connection.
|