org.eclipse.osgi.framework.internal.core
Class BundleURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by org.eclipse.osgi.framework.internal.core.BundleURLConnection

public class BundleURLConnection
extends java.net.URLConnection

URLConnection for BundleClassLoader resources.


Field Summary
protected  BundleEntry bundleEntry
          BundleEntry that the URL is associated.
protected  java.lang.String contentType
          content type for this URLConnection
protected  java.io.InputStream in
          InputStream for this URLConnection.
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
BundleURLConnection(java.net.URL url, BundleEntry bundleEntry)
          Constructor for a BundleClassLoader resource URLConnection.
 
Method Summary
 void connect()
           
 int getContentLength()
           
 java.lang.String getContentType()
           
 boolean getDoInput()
           
 boolean getDoOutput()
           
 java.net.URL getFileURL()
          Converts the URL to a URL that uses the file: protocol.
 java.io.InputStream getInputStream()
           
 long getLastModified()
           
 java.net.URL getLocalURL()
          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, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

bundleEntry

protected final BundleEntry bundleEntry
BundleEntry that the URL is associated.


in

protected java.io.InputStream in
InputStream for this URLConnection.


contentType

protected java.lang.String contentType
content type for this URLConnection

Constructor Detail

BundleURLConnection

public BundleURLConnection(java.net.URL url,
                           BundleEntry bundleEntry)
Constructor for a BundleClassLoader resource URLConnection.

Parameters:
url - URL for this URLConnection.
bundleEntry - BundleEntry that the URLConnection is associated.
Method Detail

connect

public void connect()
             throws java.io.IOException
Specified by:
connect in class java.net.URLConnection
Throws:
java.io.IOException

getContentLength

public int getContentLength()
Overrides:
getContentLength in class java.net.URLConnection

getContentType

public java.lang.String getContentType()
Overrides:
getContentType in class java.net.URLConnection

getDoInput

public boolean getDoInput()
Overrides:
getDoInput in class java.net.URLConnection

getDoOutput

public boolean getDoOutput()
Overrides:
getDoOutput in class java.net.URLConnection

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Overrides:
getInputStream in class java.net.URLConnection
Throws:
java.io.IOException

getLastModified

public long getLastModified()
Overrides:
getLastModified in class java.net.URLConnection

getLocalURL

public java.net.URL 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

public java.net.URL 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