public class BundleGeneratorUtils extends Object
| Constructor and Description |
|---|
BundleGeneratorUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
convertFromJarToBundle(Path jarFile,
Path targetDirectory,
Manifest manifest,
String extensionPrefix)
Converts a specified JAR file to an OSGi bundle at the specified destination.
|
static void |
createBundle(Path jarFile,
Path bundlePath,
Manifest manifest)
Creates an OSGi bundle out of a JAR file.
|
static boolean |
delete(Path path)
Deletes the specified file or the directory and its child content.
|
static List<Path> |
listFiles(Path directory)
Returns a
List of file paths of the child elements of the specified directory. |
static List<String> |
listPackages(Path jarFile)
Returns a
List of String Java package names within the JAR file. |
static List<Path> |
listZipFileContent(Path zipFilePath)
Returns a list of content in the .zip or .jar file corresponding to the
zipFilePath Path instance, in the
form of Path instances. |
public static void convertFromJarToBundle(Path jarFile, Path targetDirectory, Manifest manifest, String extensionPrefix) throws IOException, JarToBundleConverterException
jarFile - the JAR file to be bundledtargetDirectory - the directory into which the created OSGi bundle needs to be placedmanifest - the OSGi bundle manifest fileextensionPrefix - prefix, if any, for the bundleIOException - if an I/O error occurs while reading the JAR or generating the bundleJarToBundleConverterException - if the Path representing the JAR file has no elements or if an
error occurs when generating the bundlepublic static void createBundle(Path jarFile, Path bundlePath, Manifest manifest) throws IOException, JarToBundleConverterException
jarFile - the JAR file to be bundledbundlePath - the directory into which the created OSGi bundlePath needs to be placed intomanifest - the OSGi bundlePath manifest fileIOException - if an I/O error occurs while reading the JAR or generating the bundlePathJarToBundleConverterException - if JAR file cannot be copied to the temporary directory or if an error
occurs when archiving the final bundlePath directorypublic static boolean delete(Path path) throws IOException
path - the Path to the file or the directory and its child content to be deletedIOException - if an I/O error occurs during the deletionpublic static List<Path> listFiles(Path directory) throws IOException
List of file paths of the child elements of the specified directory.directory - the directory whose child elements are to be returnedList of Path instances of the child elements of the specified directoryIOException - if an I/O error occurspublic static List<String> listPackages(Path jarFile) throws IOException, JarToBundleConverterException
List of String Java package names within the JAR file.jarFile - the JAR file of which the package name list is to be returnedList of String Java package names within the JAR fileIOException - if an I/O error occursJarToBundleConverterException - if an error occurs when retrieving child content from the jarFilepublic static List<Path> listZipFileContent(Path zipFilePath) throws IOException, JarToBundleConverterException
zipFilePath Path instance, in the
form of Path instances.zipFilePath - the Path to the .zip or .jar fileList of Path instancesIOException - if an I/O error occursJarToBundleConverterException - if a non-existent Path instance or a Path instance of
invalid file format is given or if the Path representing the zip
file name has zero elementsCopyright © 2015 WSO2. All rights reserved.