Search in sources :

Example 1 with VFSTree

use of org.pentaho.di.plugins.fileopensave.providers.vfs.model.VFSTree 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;
}
Also used : VFSTree(org.pentaho.di.plugins.fileopensave.providers.vfs.model.VFSTree) VFSConnectionDetails(org.pentaho.di.connections.vfs.VFSConnectionDetails) ConnectionDetails(org.pentaho.di.connections.ConnectionDetails) VFSLocation(org.pentaho.di.plugins.fileopensave.providers.vfs.model.VFSLocation) VFSConnectionDetails(org.pentaho.di.connections.vfs.VFSConnectionDetails) ConnectionProvider(org.pentaho.di.connections.ConnectionProvider) VFSConnectionProvider(org.pentaho.di.connections.vfs.VFSConnectionProvider)

Aggregations

ConnectionDetails (org.pentaho.di.connections.ConnectionDetails)1 ConnectionProvider (org.pentaho.di.connections.ConnectionProvider)1 VFSConnectionDetails (org.pentaho.di.connections.vfs.VFSConnectionDetails)1 VFSConnectionProvider (org.pentaho.di.connections.vfs.VFSConnectionProvider)1 VFSLocation (org.pentaho.di.plugins.fileopensave.providers.vfs.model.VFSLocation)1 VFSTree (org.pentaho.di.plugins.fileopensave.providers.vfs.model.VFSTree)1