| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final URLConnection |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| 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 int | getContentLength()
Overrides java. Returns the value of the |
| public long | getContentLengthLong()
Overrides java. Returns the value of the |
| public InputStream | getInputStream()
Overrides java. Returns an input stream that reads from this open connection. |
| public long | getLastModified()
Overrides java. Returns the value of the |
| public Permission | getPermission()
Overrides java. Returns a permission object representing the permission necessary to make the connection represented by this object. |
| connected | back to summary |
|---|---|
| private boolean connected | |
| wrappedJarUrlConnection | back to summary |
|---|---|
| private final URLConnection wrappedJarUrlConnection | |
| WarURLConnection | back to summary |
|---|---|
| protected WarURLConnection(URL url) throws IOException | |
| 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.
| |
| 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
| |
| 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.
| |
| getLastModified | back to summary |
|---|---|
| public long getLastModified() Overrides java. Doc from java. Returns the value of the
| |
| getPermission | back to summary |
|---|---|
| public Permission getPermission() throws IOException Overrides java. Doc from java. 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.
| |