org.eclipse.osgi.baseadaptor.bundlefile
Class BundleFileWrapperChain

java.lang.Object
  extended by org.eclipse.osgi.baseadaptor.bundlefile.BundleFile
      extended by org.eclipse.osgi.baseadaptor.bundlefile.BundleFileWrapperChain

public class BundleFileWrapperChain
extends BundleFile

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 org.eclipse.osgi.baseadaptor.bundlefile.BundleFile
basefile, PROP_SETPERMS_CMD
 
Constructor Summary
BundleFileWrapperChain(BundleFile wrapped, BundleFileWrapperChain next)
           
 
Method Summary
 void close()
          Closes the BundleFile.
 boolean containsDir(java.lang.String dir)
          Determines if any BundleEntries exist in the given directory path.
 java.io.File getBaseFile()
          Returns the base file for this BundleFile
 BundleEntry getEntry(java.lang.String path)
          Locates a file name in this bundle and returns a BundleEntry object
 java.util.Enumeration<java.lang.String> getEntryPaths(java.lang.String path)
          Allows to access the entries of the bundle.
 java.io.File getFile(java.lang.String path, boolean nativeCode)
          Returns a File for the bundle entry specified by the path.
 BundleFileWrapperChain getNext()
          The next WrapperBundleFile in the chain.
 java.net.URL getResourceURL(java.lang.String path, BaseData hostData, int index)
          Returns a URL to access the contents of the entry specified by the path
 BundleFile getWrapped()
          The BundleFile that is wrapped
 void open()
          Opens the BundleFiles.
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.osgi.baseadaptor.bundlefile.BundleFile
fixTrailingSlash, getResourceURL, getResourceURL, setPermissions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BundleFileWrapperChain

public BundleFileWrapperChain(BundleFile wrapped,
                              BundleFileWrapperChain next)
Method Detail

close

public void close()
           throws java.io.IOException
Description copied from class: BundleFile
Closes the BundleFile.

Specified by:
close in class BundleFile
Throws:
java.io.IOException - if any error occurs.

containsDir

public boolean containsDir(java.lang.String dir)
Description copied from class: BundleFile
Determines if any BundleEntries exist in the given directory path.

Specified by:
containsDir in class BundleFile
Parameters:
dir - The directory path to check existence of.
Returns:
true if the BundleFile contains entries under the given directory path; false otherwise.

getEntry

public BundleEntry getEntry(java.lang.String path)
Description copied from class: BundleFile
Locates a file name in this bundle and returns a BundleEntry object

Specified by:
getEntry in class BundleFile
Parameters:
path - path of the entry to locate in the bundle
Returns:
BundleEntry object or null if the file name does not exist in the bundle

getEntryPaths

public java.util.Enumeration<java.lang.String> getEntryPaths(java.lang.String path)
Description copied from class: BundleFile
Allows to access the entries of the bundle. Since the bundle content is usually a jar, this allows to access the jar contents. GetEntryPaths allows to enumerate the content of "path". If path is a directory, it is equivalent to listing the directory contents. The returned names are either files or directories themselves. If a returned name is a directory, it finishes with a slash. If a returned name is a file, it does not finish with a slash.

Specified by:
getEntryPaths in class BundleFile
Parameters:
path - path of the entry to locate in the bundle
Returns:
an Enumeration of Strings that indicate the paths found or null if the path does not exist.

getFile

public java.io.File getFile(java.lang.String path,
                            boolean nativeCode)
Description copied from class: BundleFile
Returns a File for the bundle entry specified by the path. If required the content of the bundle entry is extracted into a file on the file system.

Specified by:
getFile in class BundleFile
Parameters:
path - The path to the entry to locate a File for.
nativeCode - true if the path is native code.
Returns:
A File object to access the contents of the bundle entry.

open

public void open()
          throws java.io.IOException
Description copied from class: BundleFile
Opens the BundleFiles.

Specified by:
open in class BundleFile
Throws:
java.io.IOException - if any error occurs.

getBaseFile

public java.io.File getBaseFile()
Description copied from class: BundleFile
Returns the base file for this BundleFile

Overrides:
getBaseFile in class BundleFile
Returns:
the base file for this BundleFile

getResourceURL

public java.net.URL getResourceURL(java.lang.String path,
                                   BaseData hostData,
                                   int index)
Description copied from class: BundleFile
Returns a URL to access the contents of the entry specified by the path

Overrides:
getResourceURL in class BundleFile
Parameters:
path - the path to the resource
hostData - the host BaseData
index - the resource index
Returns:
a URL to access the contents of the entry specified by the path

toString

public java.lang.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


Copyright © 2007-2012 FuseSource, Corp.. All Rights Reserved.