package click.kamil.springstatemachineexporter.analysis.service;

import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Classpath entries from the exporter tool itself — not from running Maven/Gradle on the analyzed project.
 */
public final class ToolingClasspath {

    private ToolingClasspath() {
    }

    public static List<String> currentJvmJarEntries() {
        String raw = System.getProperty("java.class.path");
        if (raw == null || raw.isBlank()) {
            return List.of();
        }
        return Arrays.stream(raw.split(File.pathSeparator))
                .filter(entry -> entry.endsWith(".jar"))
                .collect(Collectors.toList());
    }
}
