public abstract class DelegateURLConnection extends URLConnection
DelegateURLConnection
contains some other URLConnection
,
which it uses as its basic source of data, possibly transforming the data
along the way or providing additional functionality. The class
DelegateURLConnection
itself simply overrides all methods of
URLConnection
with versions that pass all requests to the contained
input stream. Subclasses of DelegateURLConnection
may further
override some of these methods and may also provide additional methods and
fields.Modifier and Type | Field and Description |
---|---|
protected URLConnection |
target
The target
URLConnection . |
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
Modifier | Constructor and Description |
---|---|
protected |
DelegateURLConnection()
Creates a new
DelegateURLConnection with a null target. |
|
DelegateURLConnection(URLConnection target)
Creates a new
DelegateURLConnection with the specified target
URLConnection . |
protected volatile URLConnection target
URLConnection
.public DelegateURLConnection(URLConnection target)
DelegateURLConnection
with the specified target
URLConnection
.target
- The target URLConnection
.NullPointerException
- If the target URLConnection
is null.protected DelegateURLConnection()
DelegateURLConnection
with a null target.public void connect() throws IOException
connect
in class URLConnection
IOException
public void setConnectTimeout(int timeout)
setConnectTimeout
in class URLConnection
public int getConnectTimeout()
getConnectTimeout
in class URLConnection
public void setReadTimeout(int timeout)
setReadTimeout
in class URLConnection
public int getReadTimeout()
getReadTimeout
in class URLConnection
public URL getURL()
getURL
in class URLConnection
public int getContentLength()
getContentLength
in class URLConnection
public long getContentLengthLong()
getContentLengthLong
in class URLConnection
public String getContentType()
getContentType
in class URLConnection
public String getContentEncoding()
getContentEncoding
in class URLConnection
public long getExpiration()
getExpiration
in class URLConnection
public long getDate()
getDate
in class URLConnection
public long getLastModified()
getLastModified
in class URLConnection
public String getHeaderField(String name)
getHeaderField
in class URLConnection
public Map<String,List<String>> getHeaderFields()
getHeaderFields
in class URLConnection
public int getHeaderFieldInt(String name, int Default)
getHeaderFieldInt
in class URLConnection
public long getHeaderFieldLong(String name, long Default)
getHeaderFieldLong
in class URLConnection
public long getHeaderFieldDate(String name, long Default)
getHeaderFieldDate
in class URLConnection
public String getHeaderFieldKey(int n)
getHeaderFieldKey
in class URLConnection
public String getHeaderField(int n)
getHeaderField
in class URLConnection
public Object getContent() throws IOException
getContent
in class URLConnection
IOException
public Object getContent(Class[] classes) throws IOException
getContent
in class URLConnection
IOException
public Permission getPermission() throws IOException
getPermission
in class URLConnection
IOException
public InputStream getInputStream() throws IOException
getInputStream
in class URLConnection
IOException
public OutputStream getOutputStream() throws IOException
getOutputStream
in class URLConnection
IOException
public void setDoInput(boolean doInput)
setDoInput
in class URLConnection
public boolean getDoInput()
getDoInput
in class URLConnection
public void setDoOutput(boolean doOutput)
setDoOutput
in class URLConnection
public boolean getDoOutput()
getDoOutput
in class URLConnection
public void setAllowUserInteraction(boolean allowUserInteraction)
setAllowUserInteraction
in class URLConnection
public boolean getAllowUserInteraction()
getAllowUserInteraction
in class URLConnection
public void setUseCaches(boolean useCaches)
setUseCaches
in class URLConnection
public boolean getUseCaches()
getUseCaches
in class URLConnection
public void setIfModifiedSince(long ifModifiedSince)
setIfModifiedSince
in class URLConnection
public long getIfModifiedSince()
getIfModifiedSince
in class URLConnection
public boolean getDefaultUseCaches()
getDefaultUseCaches
in class URLConnection
public void setDefaultUseCaches(boolean defaultUseCaches)
setDefaultUseCaches
in class URLConnection
public void setRequestProperty(String key, String value)
setRequestProperty
in class URLConnection
public void addRequestProperty(String key, String value)
addRequestProperty
in class URLConnection
public String getRequestProperty(String key)
getRequestProperty
in class URLConnection
public Map<String,List<String>> getRequestProperties()
getRequestProperties
in class URLConnection
public String toString()
toString
in class URLConnection
Copyright © 2020 LibJ. All rights reserved.