package org.udg.pds.simpleapp_javaee.util;


import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Startup;

@Singleton
@Startup
public class Global {

    String dataDir;

    @PostConstruct
    void init() {
        dataDir = System.getProperty("local.data-dir");
    }

    public String getDataDir() { return dataDir; }
}

@@ -38,16 +38,46 @@
 util;%0A%0A%0A
+import io.minio.MinioClient;%0A%0A
 import j
@@ -208,121 +208,927 @@
 l %7B%0A
-%0A
     
-String dataDir;%0A%0A    @PostConstruct%0A    void init() %7B%0A        dataDir = System.getProperty(%22local.data-dir%22)
+private MinioClient minioClient;%0A%0A    private static String BASE_URL;%0A%0A    @PostConstruct%0A    void init() %7B%0A        try %7B%0A            String minioURL = System.getProperty(%22swarm.project.minio.url%22);%0A            String minioAccessKey = System.getProperty(%22swarm.project.minio.access-key%22);%0A            String minioSecretKey = System.getProperty(%22swarm.project.minio.secret-key%22);%0A            minioClient = new MinioClient(minioURL, minioAccessKey, minioSecretKey);%0A        %7D catch (Exception e) %7B%0A        %7D%0A%0A        if (System.getProperty(%22swarm.project.base-url%22) != null)%0A            BASE_URL = System.getProperty(%22swarm.project.base-url%22);%0A        else %7B%0A            String port = System.getProperty(%22swarm.http.port%22) != null ? System.getProperty(%22swarm.http.port%22) : %228080%22;%0A            BASE_URL = %22http://localhost:%22 + port;%0A        %7D%0A    %7D%0A%0A    public MinioClient getMinioClient() %7B%0A        return minioClient
 ;%0A  
@@ -1157,15 +1157,15 @@
  get
-DataDir
+BaseURL
 () %7B
@@ -1176,15 +1176,16 @@
 urn 
-dataDir
+BASE_URL
 ; %7D%0A

Add minio support. Add base URL for image REST access