- java.lang.Object
-
- java.net.URLConnection
-
- org.arakhne.afc.vmutil.resource.URLConnection
-
public class URLConnection extends URLConnection
The classURLConnectionis implementing connection between an URL and a Java resource. Instances of this class can be used to read from the resource referenced by the resource URL. Write is allowed depending on where resource is located.Supported header fields are the same as the real resource URL (basicaly, file or jar protocols).
- 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 protectedURLConnection(URL url)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect()StringgetHeaderField(int index)StringgetHeaderField(String name)StringgetHeaderFieldKey(int index)Map<String,List<String>>getHeaderFields()InputStreamgetInputStream()OutputStreamgetOutputStream()-
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:
getHeaderFieldin classURLConnection
-
getHeaderField
public String getHeaderField(String name)
- Overrides:
getHeaderFieldin classURLConnection
-
getHeaderFieldKey
public String getHeaderFieldKey(int index)
- Overrides:
getHeaderFieldKeyin classURLConnection
-
getHeaderFields
public Map<String,List<String>> getHeaderFields()
- Overrides:
getHeaderFieldsin classURLConnection
-
connect
public void connect() throws IOException- Specified by:
connectin classURLConnection- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream() throws IOException
- Overrides:
getOutputStreamin classURLConnection- Throws:
IOException
-
getInputStream
public InputStream getInputStream() throws IOException
- Overrides:
getInputStreamin classURLConnection- Throws:
IOException
-
-