Search in sources :

Example 1 with RepositoryTree

use of org.pentaho.di.plugins.fileopensave.providers.repository.model.RepositoryTree in project pentaho-kettle by pentaho.

the class RepositoryFileProvider method loadDirectoryTree.

public RepositoryTree loadDirectoryTree() {
    if (getRepository() != null) {
        try {
            if (getRepository() instanceof RepositoryExtended) {
                rootDirectory = ((RepositoryExtended) getRepository()).loadRepositoryDirectoryTree(false);
            } else {
                rootDirectory = getRepository().loadRepositoryDirectoryTree();
            }
            RepositoryTree repositoryTree = new RepositoryTree(null);
            RepositoryDirectory repositoryDirectory = RepositoryDirectory.build(null, rootDirectory);
            populateFolders(repositoryDirectory, rootDirectory);
            boolean isPentahoRepository = getRepository().getRepositoryMeta().getId().equals(PENTAHO_ENTERPRISE_REPOSITORY);
            if (!isPentahoRepository) {
                populateFiles(repositoryDirectory, rootDirectory, FILTER);
            }
            for (RepositoryFile child : repositoryDirectory.getChildren()) {
                repositoryTree.addChild(child);
            }
            return repositoryTree;
        } catch (Exception e) {
            return null;
        }
    }
    return null;
}
Also used : RepositoryDirectory(org.pentaho.di.plugins.fileopensave.providers.repository.model.RepositoryDirectory) RepositoryExtended(org.pentaho.di.repository.RepositoryExtended) RepositoryTree(org.pentaho.di.plugins.fileopensave.providers.repository.model.RepositoryTree) RepositoryFile(org.pentaho.di.plugins.fileopensave.providers.repository.model.RepositoryFile) KettleException(org.pentaho.di.core.exception.KettleException) InvalidFileTypeException(org.pentaho.di.plugins.fileopensave.api.providers.exception.InvalidFileTypeException) FileException(org.pentaho.di.plugins.fileopensave.api.providers.exception.FileException) KettleObjectExistsException(org.pentaho.di.core.exception.KettleObjectExistsException) KettleTransException(org.pentaho.di.core.exception.KettleTransException) KettleJobException(org.pentaho.di.core.exception.KettleJobException) InvalidFileOperationException(org.pentaho.di.plugins.fileopensave.api.providers.exception.InvalidFileOperationException) FileExistsException(org.pentaho.di.plugins.fileopensave.api.providers.exception.FileExistsException)

Example 2 with RepositoryTree

use of org.pentaho.di.plugins.fileopensave.providers.repository.model.RepositoryTree in project pentaho-kettle by pentaho.

the class RepositoryFileProvider method getTree.

@Override
public RepositoryTree getTree() {
    RepositoryTree repositoryTree = new RepositoryTree(NAME);
    repositoryTree.setChildren(loadDirectoryTree().getChildren());
    return repositoryTree;
}
Also used : RepositoryTree(org.pentaho.di.plugins.fileopensave.providers.repository.model.RepositoryTree)

Aggregations

RepositoryTree (org.pentaho.di.plugins.fileopensave.providers.repository.model.RepositoryTree)2 KettleException (org.pentaho.di.core.exception.KettleException)1 KettleJobException (org.pentaho.di.core.exception.KettleJobException)1 KettleObjectExistsException (org.pentaho.di.core.exception.KettleObjectExistsException)1 KettleTransException (org.pentaho.di.core.exception.KettleTransException)1 FileException (org.pentaho.di.plugins.fileopensave.api.providers.exception.FileException)1 FileExistsException (org.pentaho.di.plugins.fileopensave.api.providers.exception.FileExistsException)1 InvalidFileOperationException (org.pentaho.di.plugins.fileopensave.api.providers.exception.InvalidFileOperationException)1 InvalidFileTypeException (org.pentaho.di.plugins.fileopensave.api.providers.exception.InvalidFileTypeException)1 RepositoryDirectory (org.pentaho.di.plugins.fileopensave.providers.repository.model.RepositoryDirectory)1 RepositoryFile (org.pentaho.di.plugins.fileopensave.providers.repository.model.RepositoryFile)1 RepositoryExtended (org.pentaho.di.repository.RepositoryExtended)1