package org.implab.gradle.common.core.os;

import java.io.File;
import java.util.function.Function;
import java.util.stream.Stream;

class Windows extends GenericSystem {

    private Stream<String> exeSuffixes = Stream.of(".cmd", ".bat", ".exe");

    Windows(String name, String version) {
        super(name, version);
    }

    @Override
    public String family() {
        return OperatingSystem.WINDOWS_FAMILY;
    }

    @Override
    protected Function<File, Stream<File>> candidates(String cmd) {
        return base -> exeSuffixes.map(suffix -> new File(base, cmd + suffix));
    }
}
