use of org.pentaho.di.connections.ConnectionDetails in project pentaho-kettle by pentaho.
the class VFSFileProvider method getTree.
/**
* Filtered implementation
*
* @return Filter Tree
*/
@Override
public VFSTree getTree(List<String> connectionTypes) {
VFSTree vfsTree = new VFSTree(NAME);
List<ConnectionProvider<? extends ConnectionDetails>> providers = connectionManagerSupplier.get().getProvidersByType(VFSConnectionProvider.class);
for (ConnectionProvider<? extends ConnectionDetails> provider : providers) {
for (ConnectionDetails connectionDetails : provider.getConnectionDetails()) {
VFSConnectionDetails vfsConnectionDetails = (VFSConnectionDetails) connectionDetails;
VFSLocation vfsLocation = new VFSLocation();
vfsLocation.setName(connectionDetails.getName());
vfsLocation.setRoot(NAME);
vfsLocation.setHasChildren(true);
vfsLocation.setCanDelete(false);
vfsLocation.setPath(vfsConnectionDetails.getType() + "://" + vfsConnectionDetails.getDomain());
vfsLocation.setDomain(vfsConnectionDetails.getDomain());
vfsLocation.setConnection(connectionDetails.getName());
if (connectionTypes.isEmpty() || connectionTypes.contains(connectionDetails.getType())) {
vfsTree.addChild(vfsLocation);
}
}
}
return vfsTree;
}
Aggregations