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;
}
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;
}
Aggregations