throw new TeiidRuntimeException("System VDB not found");
}
}
public static TransformationMetadata getVDBMetadata(URL vdbURL, URL udfFile) throws IOException {
TransformationMetadata vdbmetadata = VDB_CACHE.get(vdbURL);
if (vdbmetadata != null) {
return vdbmetadata;
}
try {
IndexMetadataFactory imf = loadMetadata(vdbURL);
Collection <FunctionMethod> methods = null;
Collection<FunctionTree> trees = null;
if (udfFile != null) {
String schema = FileUtils.getFilenameWithoutExtension(udfFile.getPath());
methods = FunctionMetadataReader.loadFunctionMethods(udfFile.openStream());
trees = Arrays.asList(new FunctionTree(schema, new UDFSource(methods), true));
}
SystemFunctionManager sfm = new SystemFunctionManager();
vdbmetadata = new TransformationMetadata(null, new CompositeMetadataStore(Arrays.asList(getSystem(), imf.getMetadataStore(getSystem().getDatatypes()))), imf.getEntriesPlusVisibilities(), sfm.getSystemFunctions(), trees);
VDB_CACHE.put(vdbURL, vdbmetadata);
return vdbmetadata;
} catch (URISyntaxException e) {
throw new IOException(e);
} catch (JAXBException e) {