package dev.dinauer.maven;

import dev.dinauer.maven.maven.core.Service;
import io.quarkus.arc.profile.IfBuildProfile;
import io.quarkus.runtime.Startup;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

@ApplicationScoped
@IfBuildProfile("test")
public class Dev
{
    @Inject
    Service service;

    @Startup
    void init() throws IOException
    {
        service.upload("/org/apache/httpcomponents/client5/httpclient5/5.6/httpclient5-5.6.jar", Files.readAllBytes(Path.of("/home/andreas/Documents/dev/maven/core/core/src/main/resources/jar/httpclient5-5.6.jar"))).close();

        service.upload("/com/fasterxml/jackson/core/jackson-core/2.21.0/jackson-core-2.21.0.jar", Files.readAllBytes(Path.of("/home/andreas/Documents/dev/maven/core/core/src/main/resources/jar/jackson-core-2.21.0.jar"))).close();

        service.upload("/org/postgresql/postgresql/42.7.9/postgresql-42.7.9.jar", Files.readAllBytes(Path.of("/home/andreas/Documents/dev/maven/core/core/src/main/resources/jar/postgresql-42.7.9.jar"))).close();
        service.upload("/org/postgresql/postgresql/42.2.9/postgresql-42.2.9.jar", Files.readAllBytes(Path.of("/home/andreas/Documents/dev/maven/core/core/src/main/resources/jar/postgresql-42.7.9.jar"))).close();
        service.upload("/org/postgresql/postgresql/42.4.9/postgresql-42.4.9.jar", Files.readAllBytes(Path.of("/home/andreas/Documents/dev/maven/core/core/src/main/resources/jar/postgresql-42.7.9.jar"))).close();
        service.upload("/org/postgresql/postgresql/41.4.9/postgresql-41.4.9.jar", Files.readAllBytes(Path.of("/home/andreas/Documents/dev/maven/core/core/src/main/resources/jar/postgresql-42.7.9.jar"))).close();
        service.upload("/org/postgresql/postgresql/41.4.9/postgresql-41.4.9.pom", Files.readAllBytes(Path.of("/home/andreas/Documents/dev/maven/core/core/src/main/resources/jar/postgresql-42.7.9.pom"))).close();
    }
}
