Search in sources :

Example 1 with RecentTree

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)

Aggregations

InputStream (java.io.InputStream)1 Calendar (java.util.Calendar)1 Collections (java.util.Collections)1 Date (java.util.Date)1 List (java.util.List)1 Supplier (java.util.function.Supplier)1 Collectors (java.util.stream.Collectors)1 LastUsedFile (org.pentaho.di.core.LastUsedFile)1 BaseFileProvider (org.pentaho.di.plugins.fileopensave.api.providers.BaseFileProvider)1 File (org.pentaho.di.plugins.fileopensave.api.providers.File)1 Tree (org.pentaho.di.plugins.fileopensave.api.providers.Tree)1 FileException (org.pentaho.di.plugins.fileopensave.api.providers.exception.FileException)1 RecentFile (org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentFile)1 RecentTree (org.pentaho.di.plugins.fileopensave.providers.recents.model.RecentTree)1 PropsUI (org.pentaho.di.ui.core.PropsUI)1