private Iterable<InputStream> findBlueprints(BundleManifest bundleMf, IDirectory bundle) throws IOException
{
_logger.debug(LOG_ENTRY, "findBlueprints", bundle);
Collection<IFile> blueprints = new ArrayList<IFile>();
BundleBlueprintParser bpParser = new BundleBlueprintParser(bundleMf);
List<IFile> files = bundle.listAllFiles();
Iterator<IFile> it = files.iterator();
while (it.hasNext()) {
IFile file = it.next();
String directoryFullPath = file.getName();
String directoryName = "";
String fileName = "";
if (directoryFullPath.lastIndexOf("/") != -1) {
// This bundle may be nested within another archive. In that case, we need to trim
// /bundleFileName.jar from the front of the directory.
int bundleNameLength = bundle.getName().length();
directoryName = directoryFullPath.substring(bundleNameLength, directoryFullPath.lastIndexOf("/"));
if (directoryName.startsWith("/") && directoryName.length() > 1) {
directoryName = directoryName.substring(1);
}
fileName = directoryFullPath.substring(directoryFullPath.lastIndexOf("/") + 1);
} else {
if (file.isFile()) {
directoryName="";
fileName = directoryFullPath;
}
}
if (bpParser.isBPFile(directoryName, fileName)) {
blueprints.add(file);
}
}
Collection<InputStream> result = new ArrayList<InputStream>();