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