}
public BundleConversion convert(IDirectory parentEba, final IFile toBeConverted) {
if (toBeConverted.getName().endsWith(WAR_FILE_EXTENSION)) {
try {
final WabConversion conversion = wabConverter.convert(new InputStreamProvider() {
public InputStream getInputStream() throws IOException {
return toBeConverted.open();
}
}, toBeConverted.getName(), new Properties());
return new BundleConversion() {
public BundleInfo getBundleInfo(ApplicationMetadataFactory amf) throws IOException {
return new SimpleBundleInfo(amf, BundleManifest.fromBundle(conversion.getWAB()), toBeConverted.toString());
}
public InputStream getInputStream() throws IOException {
return conversion.getWAB();
}
};
} catch (IOException e) {
LOGGER.error("Encountered an exception while converting " + toBeConverted.getName()