- java.lang.Object
-
- java.net.URLConnection
-
- org.arakhne.afc.vmutil.file.URLConnection
-
public class URLConnection extends URLConnection
The classURLConnection
is implementing connection between an URL and a local file. Instances of this class can be used both to read from and to write to the resource referenced by the file URL.Supported header fields are:
content-type
content-length
last-modified
- Since:
- 6.0
- Version:
- 17.0 2020-01-04 14:41:35
- Author:
- Stéphane GALLAND, $Author: willaume$
- See Also:
URLConnection
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- vmutils
-
-
Field Summary
-
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
URLConnection(URL url)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect()
String
getHeaderField(int index)
String
getHeaderField(String name)
String
getHeaderFieldKey(int index)
Map<String,List<String>>
getHeaderFields()
InputStream
getInputStream()
OutputStream
getOutputStream()
-
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldLong, getIfModifiedSince, getLastModified, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
-
-
-
-
Constructor Detail
-
URLConnection
protected URLConnection(URL url)
Constructor.- Parameters:
url
- is the "file"-protocol url to use.
-
-
Method Detail
-
getHeaderField
public String getHeaderField(int index)
- Overrides:
getHeaderField
in classURLConnection
-
getHeaderField
public String getHeaderField(String name)
- Overrides:
getHeaderField
in classURLConnection
-
getHeaderFieldKey
public String getHeaderFieldKey(int index)
- Overrides:
getHeaderFieldKey
in classURLConnection
-
getHeaderFields
public Map<String,List<String>> getHeaderFields()
- Overrides:
getHeaderFields
in classURLConnection
-
connect
public void connect() throws IOException
- Specified by:
connect
in classURLConnection
- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream() throws IOException
- Overrides:
getOutputStream
in classURLConnection
- Throws:
IOException
-
getInputStream
public InputStream getInputStream() throws IOException
- Overrides:
getInputStream
in classURLConnection
- Throws:
IOException
-
-