All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.nosqlbench.nb.api.content.NBIORelativizer Maven / Gradle / Ivy

There is a newer version: 4.15.102
Show newest version
package io.nosqlbench.nb.api.content;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class NBIORelativizer {

    public static List relativizePaths(Path base, List contained) {
        List relativized = new ArrayList<>();
        for (Path path : contained) {
            Path relative = base.relativize(path);
            relativized.add(relative);
        }
        return relativized;
    }

    public static List relativizeContent(Path base, List> contained) {
        return relativizePaths(
            base,
            contained.stream().map(Content::asPath).collect(Collectors.toList()));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy