public class FileURLConnection extends URLConnection
| Modifier and Type | Field and Description |
|---|---|
protected File |
file
The underlying file
|
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches| Constructor and Description |
|---|
FileURLConnection(URL url) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Checks if the underlying file for this connection exists.
|
File |
getFile()
Returns the underlying file for this connection.
|
String |
getHeaderField(String name)
Provides support for the following headers:
last-modified
content-length
content-type
date
|
InputStream |
getInputStream() |
long |
getLastModified()
Returns the last modified time of the underlying file.
|
OutputStream |
getOutputStream() |
Permission |
getPermission()
Return a permission for reading of the file
|
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFieldLong, getHeaderFields, getIfModifiedSince, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toStringprotected final File file
public FileURLConnection(URL url) throws IOException
IOExceptionpublic File getFile()
public void connect()
throws IOException
connect in class URLConnectionFileNotFoundExceptionIOExceptionpublic InputStream getInputStream() throws IOException
getInputStream in class URLConnectionIOExceptionpublic OutputStream getOutputStream() throws IOException
getOutputStream in class URLConnectionIOExceptionpublic String getHeaderField(String name)
getHeaderField in class URLConnectionpublic Permission getPermission() throws IOException
getPermission in class URLConnectionIOExceptionpublic long getLastModified()
getLastModified in class URLConnectionCopyright © 2015 JBoss by Red Hat. All rights reserved.