Nuxeo Enterprise Platform 5.4

org.nuxeo.osgi
Class DirectoryBundleFile

java.lang.Object
  extended by org.nuxeo.osgi.DirectoryBundleFile
All Implemented Interfaces:
BundleFile
Direct Known Subclasses:
SystemBundleFile

public class DirectoryBundleFile
extends java.lang.Object
implements BundleFile

Author:
Bogdan Stefanescu

Constructor Summary
DirectoryBundleFile(java.io.File file)
           
DirectoryBundleFile(java.io.File file, java.util.jar.Manifest mf)
           
 
Method Summary
 java.util.Enumeration<java.net.URL> findEntries(java.lang.String name, java.lang.String pattern, boolean recurse)
          Finds entries in that bundle.
 java.util.Collection<BundleFile> findNestedBundles(java.io.File tmpDir)
          Get a list with nested bundles or null if none.
 java.net.URL getEntry(java.lang.String name)
          Gets the entry at the given path in this bundle.
 java.util.Enumeration<java.lang.String> getEntryPaths(java.lang.String path)
          Returns an Enumeration of all the paths (String objects) to entries within the bundle whose longest sub-path matches the supplied path argument.
 java.io.File getFile()
          Gets the current location of the bundle as a file.
 java.lang.String getFileName()
          Gets the original file name of this bundle.
 java.lang.String getLocation()
          Gets the original location of this bundle.
 java.util.jar.Manifest getManifest()
          Gets the bundle manifest.
 java.util.Collection<BundleFile> getNestedBundles(java.io.File tmpDir)
          Gets a list with nested bundles or null if none.
 java.lang.String getSymbolicName()
          Gets this bundle symbolic name.
 java.net.URL getURL()
          Gets the current location of the bundle as an URL (it may be different from the original location).
 boolean isDirectory()
          Checks if this bundle is a directory (an exploded jar).
 boolean isJar()
          Checks if this bundle is a JAR.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectoryBundleFile

public DirectoryBundleFile(java.io.File file)
                    throws java.io.IOException
Throws:
java.io.IOException

DirectoryBundleFile

public DirectoryBundleFile(java.io.File file,
                           java.util.jar.Manifest mf)
Method Detail

findEntries

public java.util.Enumeration<java.net.URL> findEntries(java.lang.String name,
                                                       java.lang.String pattern,
                                                       boolean recurse)
Description copied from interface: BundleFile
Finds entries in that bundle.

Specified by:
findEntries in interface BundleFile
See Also:
Bundle.findEntries(String, String, boolean)

getEntry

public java.net.URL getEntry(java.lang.String name)
Description copied from interface: BundleFile
Gets the entry at the given path in this bundle.

Specified by:
getEntry in interface BundleFile
Returns:
the entry URL if any null otherwise
See Also:
Bundle.getEntry(String)

getEntryPaths

public java.util.Enumeration<java.lang.String> getEntryPaths(java.lang.String path)
Description copied from interface: BundleFile
Returns an Enumeration of all the paths (String objects) to entries within the bundle whose longest sub-path matches the supplied path argument.

Specified by:
getEntryPaths in interface BundleFile
See Also:
Bundle.getEntryPaths(String)

getFile

public java.io.File getFile()
Description copied from interface: BundleFile
Gets the current location of the bundle as a file.

Specified by:
getFile in interface BundleFile
Returns:
the bundle file or null if the bundle is not a file

getFileName

public java.lang.String getFileName()
Description copied from interface: BundleFile
Gets the original file name of this bundle.

Specified by:
getFileName in interface BundleFile
Returns:
the bundle file name

getLocation

public java.lang.String getLocation()
Description copied from interface: BundleFile
Gets the original location of this bundle.

This is an URI string pointing to the original locatioon of the bundle.

Specified by:
getLocation in interface BundleFile
Returns:
the location

getManifest

public java.util.jar.Manifest getManifest()
Description copied from interface: BundleFile
Gets the bundle manifest.

Specified by:
getManifest in interface BundleFile
Returns:
the bundle manifest

getNestedBundles

public java.util.Collection<BundleFile> getNestedBundles(java.io.File tmpDir)
                                                  throws java.io.IOException
Description copied from interface: BundleFile
Gets a list with nested bundles or null if none. The bundle Manifest headers Bundle-ClassPath and Class-Path will be used to retrieve nested jars.

Specified by:
getNestedBundles in interface BundleFile
Parameters:
tmpDir - optional temporary dir if the nested bundle should be extracted from an archive
Throws:
java.io.IOException

findNestedBundles

public java.util.Collection<BundleFile> findNestedBundles(java.io.File tmpDir)
                                                   throws java.io.IOException
Description copied from interface: BundleFile
Get a list with nested bundles or null if none. The bundle file will be scanned for nested JARs.

Specified by:
findNestedBundles in interface BundleFile
Parameters:
tmpDir - optional temporary dir if the nested bundle should be extracted from an archive
Throws:
java.io.IOException

getSymbolicName

public java.lang.String getSymbolicName()
Description copied from interface: BundleFile
Gets this bundle symbolic name. If this bundle is an OSGi bundle, then the Bundle-SymbolicName manifest header is returned, otherwise null is returned.

Specified by:
getSymbolicName in interface BundleFile
Returns:
null if not an OSGi bundle, the OSGI bundle symbolic name otherwise

getURL

public java.net.URL getURL()
Description copied from interface: BundleFile
Gets the current location of the bundle as an URL (it may be different from the original location).

Specified by:
getURL in interface BundleFile
Returns:
the bundle url

isDirectory

public boolean isDirectory()
Description copied from interface: BundleFile
Checks if this bundle is a directory (an exploded jar).

Specified by:
isDirectory in interface BundleFile
Returns:
true if the bundle is a directory, false otherwise

isJar

public boolean isJar()
Description copied from interface: BundleFile
Checks if this bundle is a JAR.

Specified by:
isJar in interface BundleFile
Returns:
true if the bundle is a JAR, false otherwise

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.