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 URLConnection

URLConnection for BundleClassLoader resources.


Field Summary
protected  BundleEntry bundleEntry
          BundleEntry that the URL is associated.
protected  String contentType
          content type for this URLConnection
protected  InputStream in
          InputStream for this URLConnection.
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
BundleURLConnection(URL url, BundleEntry bundleEntry)
          Constructor for a BundleClassLoader resource URLConnection.
 
Method Summary
 void connect()
           
 int getContentLength()
           
 String getContentType()
           
 boolean getDoInput()
           
 boolean getDoOutput()
           
 URL getFileURL()
          Converts the URL to a URL that uses the file: protocol.
 InputStream getInputStream()
           
 long getLastModified()
           
 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 InputStream in
InputStream for this URLConnection.


contentType

protected String contentType
content type for this URLConnection

Constructor Detail

BundleURLConnection

public BundleURLConnection(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 IOException
Specified by:
connect in class URLConnection
Throws:
IOException

getContentLength

public int getContentLength()
Overrides:
getContentLength in class URLConnection

getContentType

public String getContentType()
Overrides:
getContentType in class URLConnection

getDoInput

public boolean getDoInput()
Overrides:
getDoInput in class URLConnection

getDoOutput

public boolean getDoOutput()
Overrides:
getDoOutput in class URLConnection

getInputStream

public InputStream getInputStream()
                           throws IOException
Overrides:
getInputStream in class URLConnection
Throws:
IOException

getLastModified

public long getLastModified()
Overrides:
getLastModified in class URLConnection

getLocalURL

public 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 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


Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.