# Class BundleFileWrapperChain

java.lang.Object
org.eclipse.osgi.storage.bundlefile.BundleFile
org.eclipse.osgi.storage.bundlefile.BundleFileWrapper
org.eclipse.osgi.storage.bundlefile.BundleFileWrapperChain

public class BundleFileWrapperChain extends BundleFileWrapper
Used to chain the BundleFile objects returned from `BundleFileWrapperFactoryHook`. This class is useful for traversing the chain of wrapped bundle files.

## Field Summary

### Fields inherited from class BundleFile

`basefile`

## Constructor Summary

Constructors
Constructor
Description
`BundleFileWrapperChain(BundleFile wrapped, BundleFileWrapperChain next)`

## Method Summary

Modifier and Type
Method
Description
`BundleFileWrapperChain`
`getNext()`
The next WrapperBundleFile in the chain.
`BundleFile`
`getWrapped()`
The BundleFile that is wrapped
`<T> T`
`getWrappedType(Class<T> type)`
Returns the first bundle file wrapped in this chain which also is an instance of the specified type.
`String`
`toString()`

### Methods inherited from class BundleFileWrapper

`close, containsDir, createResourceURL, getBundleFile, getEntry, getEntryPaths, getEntryPaths, getFile, open`

### Methods inherited from class BundleFile

`createURL, fixTrailingSlash, getBaseFile, getResourceURL`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### BundleFileWrapperChain

public BundleFileWrapperChain(BundleFile wrapped, BundleFileWrapperChain next)

## Method Details

### toString

public String toString()

Overrides:
  `toString` in class `BundleFile`

### getWrapped

public BundleFile getWrapped()
The BundleFile that is wrapped

Returns:
  the BunldeFile that is wrapped

### getNext

public BundleFileWrapperChain getNext()
The next WrapperBundleFile in the chain. A `null` value is returned if this is the end of the chain.

Returns:
  the next WrapperBundleFile

### getWrappedType

public <T> T getWrappedType(Class<T> type)
Returns the first bundle file wrapped in this chain which also is an instance of the specified type.

Type Parameters:
  `T` - The type being searched for
Parameters:
  `type` - the class of the type being searched for
Returns:
  the found bundle file that is an instance of the specified type