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, toString
protected final File file
public FileURLConnection(URL url) throws IOException
IOException
public File getFile()
public void connect() throws IOException
connect
in class URLConnection
FileNotFoundException
IOException
public InputStream getInputStream() throws IOException
getInputStream
in class URLConnection
IOException
public OutputStream getOutputStream() throws IOException
getOutputStream
in class URLConnection
IOException
public String getHeaderField(String name)
getHeaderField
in class URLConnection
public Permission getPermission() throws IOException
getPermission
in class URLConnection
IOException
public long getLastModified()
getLastModified
in class URLConnection
Copyright © 2018 JBoss by Red Hat. All rights reserved.