| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String | |
| private List | |
| private boolean | |
| private final File | |
| private static final boolean | |
| private boolean | |
| private InputStream | |
| private boolean | |
| private static final String | |
| private long | |
| private 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. If already connected, then this method is a no-op. |
| protected synchronized void | ensureCanServeHeaders()
Overrides sun. This method is called whenever the headers related methods are called on the
|
| public int | getContentLength()
Overrides sun. Call this routine to get the content-length associated with this object. |
| public long | getContentLengthLong()
Overrides java. Returns the value of the |
| public String | getHeaderField(String name)
Overrides sun. Returns the value of the named header field. |
| public String | getHeaderField(int n)
Overrides sun. Return the value for the nth header field. |
| public String | getHeaderFieldKey(int n)
Overrides sun. Return the key for the nth header field. |
| public Map | getHeaderFields()
Overrides sun. Returns an unmodifiable Map of the header fields. |
| public synchronized 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.
Deprecated
for removal since 25.
Returns a permission object representing the permission necessary to make the connection represented by this object. |
| public MessageHeader | getProperties()
Overrides sun. Call this routine to get the property list for this object. |
| private void | |
| pack-priv static void | requireFtpFallbackEnabled()
Throw |
| CONTENT_LENGTH | back to summary |
|---|---|
| private static final String CONTENT_LENGTH | |
| CONTENT_TYPE | back to summary |
|---|---|
| private static final String CONTENT_TYPE | |
| directoryListing | back to summary |
|---|---|
| private List<String> directoryListing | |
| exists | back to summary |
|---|---|
| private boolean exists | |
| file | back to summary |
|---|---|
| private final File file | |
| FTP_FALLBACK_ENABLED | back to summary |
|---|---|
| private static final boolean FTP_FALLBACK_ENABLED | |
| initializedHeaders | back to summary |
|---|---|
| private boolean initializedHeaders | |
| is | back to summary |
|---|---|
| private InputStream is | |
| isDirectory | back to summary |
|---|---|
| private boolean isDirectory | |
| LAST_MODIFIED | back to summary |
|---|---|
| private static final String LAST_MODIFIED | |
| lastModified | back to summary |
|---|---|
| private long lastModified | |
| length | back to summary |
|---|---|
| private 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. If already connected, then this method is a no-op. If not already connected, then this method does readability checks for the File. If the File is a directory then the readability check is done by verifying that File.list() does not return null. On the other hand, if the File is not a directory, then this method constructs a temporary FileInputStream for the File and lets the FileInputStream's constructor implementation do the necessary readability checks. That temporary FileInputStream is closed before returning from this method. In either case, if the readability checks fail, then an IOException is thrown from this method and the FileURLConnection stays unconnected. A normal return from this method implies that the FileURLConnection is connected and the readability checks have passed for the File. Note the semantics of FileURLConnection object is that the results of the various URLConnection calls, such as getContentType, getInputStream or getContentLength reflect whatever was true when connect was called.
| |
| ensureCanServeHeaders | back to summary |
|---|---|
| protected synchronized void ensureCanServeHeaders() throws IOException Overrides sun. Doc from sun. This method is called whenever the headers related methods are called on the
| |
| 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. 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.
| |
| 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() | |
| requireFtpFallbackEnabled | back to summary |
|---|---|
| pack-priv static void requireFtpFallbackEnabled() throws MalformedURLException Throw
| |