Modifier and Type | Field and Description |
---|---|
private static final String | |
private static final String | |
pack-priv String | |
pack-priv boolean | |
pack-priv File | |
pack-priv String | |
pack-priv List | |
private boolean | |
pack-priv InputStream | |
pack-priv boolean | |
private static final String | |
pack-priv long | |
pack-priv long | |
pack-priv Permission | |
private static final String |
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
public synchronized void | |
public void | connect()
Implements abstract java. |
public int | getContentLength()
Overrides sun. |
public long | getContentLengthLong()
Overrides java. content-length header field as a
long.
|
public String | getHeaderField(String
the name of a header field. name)Overrides sun. |
public String | getHeaderField(int
an index, where n)n>=0 Overrides sun. |
public String | getHeaderFieldKey(int
an index, where n)n>=0 Overrides sun. |
public Map | getHeaderFields()
Overrides sun. |
public synchronized InputStream | getInputStream()
Overrides java. |
public long | getLastModified()
Overrides java. last-modified header field.
|
public Permission | getPermission()
Overrides java. |
public MessageHeader | getProperties()
Overrides sun. |
private void |
CONTENT_LENGTH | back to summary |
---|---|
private static final String CONTENT_LENGTH |
CONTENT_TYPE | back to summary |
---|---|
private static final String CONTENT_TYPE |
contentType | back to summary |
---|---|
pack-priv String contentType |
exists | back to summary |
---|---|
pack-priv boolean exists |
file | back to summary |
---|---|
pack-priv File file |
filename | back to summary |
---|---|
pack-priv String filename |
files | back to summary |
---|---|
pack-priv List<String> files |
initializedHeaders | back to summary |
---|---|
private boolean initializedHeaders |
is | back to summary |
---|---|
pack-priv InputStream is |
isDirectory | back to summary |
---|---|
pack-priv boolean isDirectory |
LAST_MODIFIED | back to summary |
---|---|
private static final String LAST_MODIFIED |
lastModified | back to summary |
---|---|
pack-priv long lastModified |
length | back to summary |
---|---|
pack-priv long length |
permission | back to summary |
---|---|
pack-priv Permission permission |
TEXT_PLAIN | back to summary |
---|---|
private static final String TEXT_PLAIN |
FileURLConnection | back to summary |
---|---|
protected FileURLConnection(URL u, File file) |
closeInputStream | back to summary |
---|---|
public synchronized void closeInputStream() 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 sun. Doc from sun. Call this routine to get the content-length associated with this object.
|
getContentLengthLong | back to summary |
---|---|
public long getContentLengthLong() Overrides java. Doc from java. Returns the value of the
|
getHeaderField | back to summary |
---|---|
public String getHeaderField(String name) Overrides sun. 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. |
getHeaderField | back to summary |
---|---|
public String getHeaderField(int n) Overrides sun. Doc from sun. Return the value for the nth header field. Returns null if there are fewer than n fields. This can be used in conjunction with getHeaderFieldKey to iterate through all the headers in the message.
|
getHeaderFieldKey | back to summary |
---|---|
public String getHeaderFieldKey(int n) Overrides sun. Doc from sun. Return the key for the nth header field. Returns null if there are fewer than n fields. This can be used to iterate through all the headers in the message.
|
getHeaderFields | back to summary |
---|---|
public Map Overrides sun. Doc from java. Returns an unmodifiable Map of the header fields.
The Map keys are Strings that represent the
response-header field names. Each Map value is an
unmodifiable List of Strings that represents
the corresponding field values.
This method is overridden by the subclasses of |
getInputStream | back to summary |
---|---|
public synchronized 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.
|
getProperties | back to summary |
---|---|
public MessageHeader getProperties() Overrides sun. Doc from sun. Call this routine to get the property list for this object. Properties (like content-type) that have explicit getXX() methods associated with them should be accessed using those methods. |
initializeHeaders | back to summary |
---|---|
private void initializeHeaders() |