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
FieldsModifier and TypeFieldDescriptionprotected final BundleEntryBundleEntry that the URL is associated.protected Stringcontent type for this URLConnectionprotected InputStreamInputStream for this URLConnection.Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches -
Constructor Summary
ConstructorsConstructorDescriptionBundleURLConnection(URL url, ModuleContainer container, BundleEntry bundleEntry) Constructor for a BundleClassLoader resource URLConnection. -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()longbooleanbooleanConverts the URL to a URL that uses the file: protocol.longConverts 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:
connectin classURLConnection- Throws:
IOException
-
getContentLengthLong
public long getContentLengthLong()- Overrides:
getContentLengthLongin classURLConnection
-
getContentType
- Overrides:
getContentTypein classURLConnection
-
getDoInput
public boolean getDoInput()- Overrides:
getDoInputin classURLConnection
-
getDoOutput
public boolean getDoOutput()- Overrides:
getDoOutputin classURLConnection
-
getInputStream
- Overrides:
getInputStreamin classURLConnection- Throws:
IOException
-
getLastModified
public long getLastModified()- Overrides:
getLastModifiedin 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:
getBundlein interfaceBundleReference
-