| Modifier and Type | Class and Description |
|---|---|
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private static final JarFileFactory | |
| private JarEntry | |
| private JarFile |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addRequestProperty(String
the keyword by which the request is known
(e.g., " key, String accept").the value associated with it. value)Overrides java. Adds a general request property specified by a key-value pair. |
| public void | connect()
Implements abstract java. Opens a communications link to the resource referenced by this URL, if such a connection has not already been established. |
| public boolean | Returns: the value of theallowUserInteraction field for
this object.Overrides java. Returns the value of the |
| public Object | getContent()
Overrides java. Retrieves the contents of this URL connection. |
| public int | getContentLength()
Overrides java. Returns the value of the |
| public long | getContentLengthLong()
Overrides java. Returns the value of the |
| public String | getContentType()
Overrides java. Returns the value of the |
| public boolean | Returns: the default value of aURLConnection's
useCaches flag.Overrides java. Returns the default value of a |
| public String | getHeaderField(String name)
Overrides java. Returns the value of the named header field. |
| public InputStream | getInputStream()
Overrides java. Returns an input stream that reads from this open connection. |
| public JarEntry | getJarEntry()
Overrides java. Return the JAR entry object for this connection, if any. |
| public JarFile | getJarFile()
Implements abstract java. Return the JAR file for this connection. |
| public Permission | getPermission()
Overrides java.
Deprecated
for removal since 25.
Returns a permission object representing the permission necessary to make the connection represented by this object. |
| public Map | Returns: a Map of the general request properties for this connection.Overrides java. Returns an unmodifiable Map of general request properties for this connection. |
| public String | Returns: the value of the named general request property for this connection.Overrides java. Returns the value of the named general request property for this connection. |
| public boolean | Returns: the value of thisURLConnection's
useCaches field.Overrides java. Returns the value of this |
| public void | setAllowUserInteraction(boolean
the new value. allowuserinteraction)Overrides java. Set the value of the |
| public void | setDefaultUseCaches(boolean
the new value. defaultusecaches)Overrides java. Sets the default value of the |
| public void | setIfModifiedSince(long
the new value. ifmodifiedsince)Overrides java. Sets the value of the |
| public void | setRequestProperty(String
the keyword by which the request is known
(e.g., " key, String accept").the value associated with it. value)Overrides java. Sets the general request property. |
| public void | setUseCaches(boolean usecaches)
Overrides java. Sets the value of the |
| contentType | back to summary |
|---|---|
| private String contentType | |
| factory | back to summary |
|---|---|
| private static final JarFileFactory factory | |
| jarEntry | back to summary |
|---|---|
| private JarEntry jarEntry | |
| jarFile | back to summary |
|---|---|
| private JarFile jarFile | |
| JarURLConnection | back to summary |
|---|---|
| public JarURLConnection(URL url, Handler handler) throws MalformedURLException, IOException | |
| addRequestProperty | back to summary |
|---|---|
| public void addRequestProperty(String key, String value) Overrides java. Adds a general request property specified by a key-value pair. This method will not overwrite existing values associated with the same key. | |
| connect | back to summary |
|---|---|
| public void connect() throws IOException Implements abstract java. Doc from java. Opens a communications link to the resource referenced by this URL, if such a connection has not already been established.
If the URLConnection objects go through two phases: first they are created, then they are connected. After being created, and before being connected, various options can be specified (e.g., doInput and UseCaches). After connecting, it is an error to try to set them. Operations that depend on being connected, like getContentLength, will implicitly perform the connection, if necessary.
| |
| getAllowUserInteraction | back to summary |
|---|---|
| public boolean getAllowUserInteraction() Overrides java. Returns the value of the
| |
| getContent | back to summary |
|---|---|
| public Object getContent() throws IOException Overrides java. Doc from java. Retrieves the contents of this URL connection.
This method first determines the content type of the object by
calling the This is done as follows:
| |
| getContentLength | back to summary |
|---|---|
| public int getContentLength() Overrides java. Doc from java. Returns the value of the Note
| |
| getContentLengthLong | back to summary |
|---|---|
| public long getContentLengthLong() Overrides java. Doc from java. Returns the value of the | |
| getContentType | back to summary |
|---|---|
| public String getContentType() Overrides java. Doc from java. Returns the value of the | |
| getDefaultUseCaches | back to summary |
|---|---|
| public boolean getDefaultUseCaches() Overrides java. Returns the default value of a The default is "sticky", being a part of the static state of all URLConnections. This flag applies to the next, and all following URLConnections that are created.
| |
| getHeaderField | back to summary |
|---|---|
| public String getHeaderField(String name) Overrides java. Doc from java. Returns the value of the named header field. If called on a connection that sets the same header multiple times with possibly different values, only the last value is returned. | |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() throws IOException Overrides java. Doc from java. Returns an input stream that reads from this open connection. A SocketTimeoutException can be thrown when reading from the returned input stream if the read timeout expires before data is available for read.
| |
| getJarEntry | back to summary |
|---|---|
| public JarEntry getJarEntry() throws IOException Overrides java. Doc from java. Return the JAR entry object for this connection, if any. This method returns null if the JAR file URL corresponding to this connection points to a JAR file and not a JAR file entry.
| |
| getJarFile | back to summary |
|---|---|
| public JarFile getJarFile() throws IOException Implements abstract java. Doc from java. Return the JAR file for this connection.
| |
| getPermission | back to summary |
|---|---|
| public Permission getPermission() throws IOException Overrides java. Doc from java. Deprecated for removal since 25. Returns a permission object representing the permission
necessary to make the connection represented by this
object. This method returns null if no permission is
required to make the connection. By default, this method
returns The permission returned may dependent upon the state of the connection. For example, the permission before connecting may be different from that after connecting. For example, an HTTP sever, say foo.com, may redirect the connection to a different host, say bar.com. Before connecting the permission returned by the connection will represent the permission needed to connect to foo.com, while the permission returned after connecting will be to bar.com. Permissions are generally used for two purposes: to protect caches of objects obtained through URLConnections, and to check the right of a recipient to learn about a particular URL. In the first case, the permission should be obtained after the object has been obtained. For example, in an HTTP connection, this will represent the permission to connect to the host from which the data was ultimately fetched. In the second case, the permission should be obtained and tested before connecting.
| |
| getRequestProperties | back to summary |
|---|---|
| public Map Overrides java. Returns an unmodifiable Map of general request properties for this connection. The Map keys are Strings that represent the request-header field names. Each Map value is a unmodifiable List of Strings that represents the corresponding field values. | |
| getRequestProperty | back to summary |
|---|---|
| public String getRequestProperty(String key) Overrides java. Returns the value of the named general request property for this connection.
| |
| getUseCaches | back to summary |
|---|---|
| public boolean getUseCaches() Overrides java. Returns the value of this
| |
| setAllowUserInteraction | back to summary |
|---|---|
| public void setAllowUserInteraction(boolean allowuserinteraction) Overrides java. Set the value of the
| |
| setDefaultUseCaches | back to summary |
|---|---|
| public void setDefaultUseCaches(boolean defaultusecaches) Overrides java. Sets the default value of the
| |
| setIfModifiedSince | back to summary |
|---|---|
| public void setIfModifiedSince(long ifmodifiedsince) Overrides java. Sets the value of the
| |
| setRequestProperty | back to summary |
|---|---|
| public void setRequestProperty(String key, String value) Overrides java. Sets the general request property. | |
| setUseCaches | back to summary |
|---|---|
| public void setUseCaches(boolean usecaches) Overrides java. Sets the value of the Some protocols do caching of documents. Occasionally, it is important to be able to "tunnel through" and ignore the caches (e.g., the "reload" button in a browser). If the UseCaches flag on a connection is true, the connection is allowed to use whatever caches it can. If false, caches are to be ignored. The default value comes from DefaultUseCaches, which defaults to true.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closes this input stream and releases any system resources associated with the stream. |
| JarURLInputStream | back to summary |
|---|---|
| pack-priv JarURLInputStream(InputStream src) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this input stream and releases any system resources associated with the stream.
| |