package dev.dinauer; import io.quarkus.runtime.Startup; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import org.eclipse.microprofile.config.inject.ConfigProperty; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @Startup @ApplicationScoped public class WorkdirProvider { private final Path workdir; public WorkdirProvider(@ConfigProperty(name = "dev.dinauer.kubooboo.workdir") String workdir) throws IOException { Path path = Path.of(workdir); Files.createDirectories(path); this.workdir = path; } public String getWorkdir(Path subpath) { return workdir.resolve(subpath).toString(); } public Path getWorkdirPath(Path subpath) { return workdir.resolve(subpath); } }