use of org.pentaho.di.repository.pur.TransDelegate in project pentaho-kettle by pentaho.
the class StreamToTransNodeConverter method convert.
public IRepositoryFileData convert(final InputStream inputStream, final String charset, final String mimeType) {
try {
long size = inputStream.available();
TransMeta transMeta = new TransMeta();
Repository repository = connectToRepository();
Document doc = PDIImportUtil.loadXMLFrom(inputStream);
transMeta.loadXML(doc.getDocumentElement(), repository, false);
TransDelegate delegate = new TransDelegate(repository, this.unifiedRepository);
saveSharedObjects(repository, transMeta);
return new NodeRepositoryFileData(delegate.elementToDataNode(transMeta), size);
} catch (Exception e) {
logger.error(e);
return null;
}
}
Aggregations