use of org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentTree in project pentaho-kettle by pentaho.
the class RecentFileProvider method getTree.
@Override
public Tree getTree() {
RecentTree recentTree = new RecentTree(NAME);
PropsUI propsUI = getPropsUI();
Date dateThreshold = getDateThreshold();
List<LastUsedFile> lastUsedFiles = propsUI.getLastUsedFiles().stream().filter(lastUsedFile -> !lastUsedFile.getLastOpened().before(dateThreshold)).collect(Collectors.toList());
for (LastUsedFile lastUsedFile : lastUsedFiles) {
recentTree.addChild(RecentFile.create(lastUsedFile));
}
return recentTree;
}
Also used :
LastUsedFile(org.pentaho.di.core.LastUsedFile)
Date(java.util.Date)
BaseFileProvider(org.pentaho.di.plugins.fileopensave.api.providers.BaseFileProvider)
PropsUI(org.pentaho.di.ui.core.PropsUI)
Tree(org.pentaho.di.plugins.fileopensave.api.providers.Tree)
File(org.pentaho.di.plugins.fileopensave.api.providers.File)
Supplier(java.util.function.Supplier)
Collectors(java.util.stream.Collectors)
FileException(org.pentaho.di.plugins.fileopensave.api.providers.exception.FileException)
List(java.util.List)
RecentTree(org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentTree)
Calendar(java.util.Calendar)
RecentFile(org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentFile)
Collections(java.util.Collections)
InputStream(java.io.InputStream)
RecentTree(org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentTree)
Date(java.util.Date)
LastUsedFile(org.pentaho.di.core.LastUsedFile)
PropsUI(org.pentaho.di.ui.core.PropsUI)