Search in sources :

Example 6 with VersionStringComparator

use of org.talend.designer.maven.aether.comparator.VersionStringComparator in project tbd-studio-se by Talend.

the class AbstractDynamicDistribution method getAllVersions.

@Override
public List<String> getAllVersions(IDynamicMonitor monitor) throws Exception {
    Set<String> allVersion = new HashSet<>();
    DynamicDistributionManager dynamicDistributionManager = DynamicDistributionManager.getInstance();
    DynamicConfiguration dynamicConfiguration = new DynamicConfiguration();
    dynamicConfiguration.setDistribution(getDistributionName());
    IDependencyResolver dependencyResolver = dynamicDistributionManager.getDependencyResolver(dynamicConfiguration);
    List<String> allHadoopVersions = dependencyResolver.listHadoopVersions(null, null, monitor);
    if (allHadoopVersions != null) {
        allVersion.addAll(allHadoopVersions);
    }
    List<String> versionList = new LinkedList<>(allVersion);
    Collections.sort(versionList, Collections.reverseOrder(new VersionStringComparator()));
    return versionList;
}
Also used : VersionStringComparator(org.talend.designer.maven.aether.comparator.VersionStringComparator) IDependencyResolver(org.talend.hadoop.distribution.dynamic.resolver.IDependencyResolver) LinkedList(java.util.LinkedList) HashSet(java.util.HashSet)

Aggregations

VersionStringComparator (org.talend.designer.maven.aether.comparator.VersionStringComparator)6 LinkedList (java.util.LinkedList)5 ArrayList (java.util.ArrayList)3 HashSet (java.util.HashSet)3 IDependencyResolver (org.talend.hadoop.distribution.dynamic.resolver.IDependencyResolver)3 List (java.util.List)2 Entry (java.util.Map.Entry)2 DummyDynamicMonitor (org.talend.designer.maven.aether.DummyDynamicMonitor)2 TemplateBean (org.talend.hadoop.distribution.dynamic.bean.TemplateBean)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1