// Path: src/main/java/in/drifted/planisphere/util/ResourceUtil.java
// public class ResourceUtil {
// 
//     public static Collection<String> getResourceCollection(Class clazz, String path) throws IOException {
// 
//         Collection<String> resourceCollection = new HashSet<>();
// 
//         URL dirUrl = clazz.getResource(path);
// 
//         if (dirUrl == null) {
// 
//             try (
//                     InputStream in = ResourceUtil.class.getResourceAsStream(path);
//                     BufferedReader br = new BufferedReader(new InputStreamReader(in))) {
// 
//                 String line;
//                 while ((line = br.readLine()) != null) {
//                     resourceCollection.add(line);
//                 }
//             }
// 
//         } else {
// 
//             switch (dirUrl.getProtocol()) {
// 
//                 case "file":
//                     try {
//                         resourceCollection.addAll(Arrays.asList(new File(dirUrl.toURI()).list()));
// 
//                     } catch (URISyntaxException e) {
//                         throw new IOException(e);
//                     }
//                     break;
// 
//                 case "jar":
//                     String jarPath = dirUrl.getPath().substring(5, dirUrl.getPath().indexOf("!"));
//                     JarFile jar = new JarFile(URLDecoder.decode(jarPath, "UTF-8"));
//                     Enumeration<JarEntry> entries = jar.entries();
//                     while (entries.hasMoreElements()) {
//                         String name = "/" + entries.nextElement().getName();
//                         if (name.startsWith(path)) {
//                             resourceCollection.add(name.substring(path.length() + 1));
//                         }
//                     }
//             }
//         }
// 
//         return resourceCollection;
//     }
// }


import in.drifted.planisphere.util.ResourceUtil;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;
import java.util.TreeSet;


        Collection<String> templateNameCollection = new HashSet<>();

        templateNameCollection.addAll(getTemplateNameCollection(MEDIA_PRINT));
        templateNameCollection.addAll(getTemplateNameCollection(MEDIA_SCREEN));

        return templateNameCollection;
    }

    public static Collection<String> getTemplateNameCollection(String media) throws IOException {

        Collection<String> templateNameCollection = new HashSet<>();

        Properties templatesProperties = new Properties();
        templatesProperties.load(Settings.class.getResourceAsStream(Settings.FILE_PATH_TEMPLATES_PROPERTIES));

        String templateSpec = templatesProperties.getProperty(media).replace("_mode", "");
        if (templateSpec.contains("|")) {
            templateNameCollection = Arrays.asList(templateSpec.split("\\|"));
        } else {
            templateNameCollection.add(templateSpec);
        }

        return templateNameCollection;
    }

    public static Collection<String> getColorSchemeCollection(String templateName) throws IOException {

        Collection<String> colorSchemeCollection = new HashSet<>();


// Path: src/main/java/in/drifted/planisphere/util/ResourceUtil.java
// public class ResourceUtil {
// 
//     public static Collection<String> getResourceCollection(Class clazz, String path) throws IOException {
// 
//         Collection<String> resourceCollection = new HashSet<>();
// 
//         URL dirUrl = clazz.getResource(path);
// 
//         if (dirUrl == null) {
// 
//             try (
//                     InputStream in = ResourceUtil.class.getResourceAsStream(path);
//                     BufferedReader br = new BufferedReader(new InputStreamReader(in))) {
// 
//                 String line;
//                 while ((line = br.readLine()) != null) {
//                     resourceCollection.add(line);
//                 }
//             }
// 
//         } else {
// 
//             switch (dirUrl.getProtocol()) {
// 
//                 case "file":
//                     try {
//                         resourceCollection.addAll(Arrays.asList(new File(dirUrl.toURI()).list()));
// 
//                     } catch (URISyntaxException e) {
//                         throw new IOException(e);
//                     }
//                     break;
// 
//                 case "jar":
//                     String jarPath = dirUrl.getPath().substring(5, dirUrl.getPath().indexOf("!"));
//                     JarFile jar = new JarFile(URLDecoder.decode(jarPath, "UTF-8"));
//                     Enumeration<JarEntry> entries = jar.entries();
//                     while (entries.hasMoreElements()) {
//                         String name = "/" + entries.nextElement().getName();
//                         if (name.startsWith(path)) {
//                             resourceCollection.add(name.substring(path.length() + 1));
//                         }
//                     }
//             }
//         }
// 
//         return resourceCollection;
//     }
// }


// Path: src/main/java/in/drifted/planisphere/Settings.java
import in.drifted.planisphere.util.ResourceUtil;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;
import java.util.TreeSet;


        Collection<String> templateNameCollection = new HashSet<>();

        templateNameCollection.addAll(getTemplateNameCollection(MEDIA_PRINT));
        templateNameCollection.addAll(getTemplateNameCollection(MEDIA_SCREEN));

        return templateNameCollection;
    }

    public static Collection<String> getTemplateNameCollection(String media) throws IOException {

        Collection<String> templateNameCollection = new HashSet<>();

        Properties templatesProperties = new Properties();
        templatesProperties.load(Settings.class.getResourceAsStream(Settings.FILE_PATH_TEMPLATES_PROPERTIES));

        String templateSpec = templatesProperties.getProperty(media).replace("_mode", "");
        if (templateSpec.contains("|")) {
            templateNameCollection = Arrays.asList(templateSpec.split("\\|"));
        } else {
            templateNameCollection.add(templateSpec);
        }

        return templateNameCollection;
    }

    public static Collection<String> getColorSchemeCollection(String templateName) throws IOException {

        Collection<String> colorSchemeCollection = new HashSet<>();


        for (String fileName : ResourceUtil.getResourceCollection(Settings.class, "/in/drifted/planisphere/resources/templates/core")) {
