Package org.eclipse.osgi.storage.url
Class BundleURLConnection
java.lang.Object
java.net.URLConnection
org.eclipse.osgi.storage.url.BundleURLConnection
- All Implemented Interfaces:
BundleReference
URLConnection for BundleClassLoader resources.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final BundleEntry
BundleEntry that the URL is associated.protected String
content type for this URLConnectionprotected InputStream
InputStream for this URLConnection.Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
-
Constructor Summary
ConstructorDescriptionBundleURLConnection
(URL url, ModuleContainer container, BundleEntry bundleEntry) Constructor for a BundleClassLoader resource URLConnection. -
Method Summary
Modifier and TypeMethodDescriptionvoid
connect()
long
boolean
boolean
Converts the URL to a URL that uses the file: protocol.long
Converts the URL to a common local URL protocol (i.e file: or jar: protocol)Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDefaultUseCaches, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFieldLong, getHeaderFields, getIfModifiedSince, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
-
Field Details
-
bundleEntry
BundleEntry that the URL is associated. -
in
InputStream for this URLConnection. -
contentType
content type for this URLConnection
-
-
Constructor Details
-
BundleURLConnection
Constructor for a BundleClassLoader resource URLConnection.- Parameters:
url
- URL for this URLConnection.bundleEntry
- BundleEntry that the URLConnection is associated.
-
-
Method Details
-
connect
- Specified by:
connect
in classURLConnection
- Throws:
IOException
-
getContentLengthLong
public long getContentLengthLong()- Overrides:
getContentLengthLong
in classURLConnection
-
getContentType
- Overrides:
getContentType
in classURLConnection
-
getDoInput
public boolean getDoInput()- Overrides:
getDoInput
in classURLConnection
-
getDoOutput
public boolean getDoOutput()- Overrides:
getDoOutput
in classURLConnection
-
getInputStream
- Overrides:
getInputStream
in classURLConnection
- Throws:
IOException
-
getLastModified
public long getLastModified()- Overrides:
getLastModified
in classURLConnection
-
getLocalURL
Converts the URL to a common local URL protocol (i.e file: or jar: protocol)- Returns:
- the local URL using a common local protocol
-
getFileURL
Converts the URL to a URL that uses the file: protocol. The content of this URL may be downloaded or extracted onto the local filesystem to create a file URL.- Returns:
- the local URL that uses the file: protocol
-
getBundle
- Specified by:
getBundle
in interfaceBundleReference
-