// Path: src/main/java/fr/brouillard/oss/cssfx/impl/log/CSSFXLogger.java
// public static Logger logger(String loggerName) {
//     if (!isInitialized()) {
//         noop();
//     }
//     return loggerFactory.getLogger(loggerName);
// }
// 
// Path: src/main/java/fr/brouillard/oss/cssfx/api/URIToPathConverter.java
// @FunctionalInterface
// public interface URIToPathConverter {
//     public Path convert(String uri);
// }


import fr.brouillard.oss.cssfx.api.URIToPathConverter;
import static fr.brouillard.oss.cssfx.impl.log.CSSFXLogger.logger;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
                    String[] classesTransform = {
                            "src/main/java", "src/main/resources" };
                    for (String ct : classesTransform) {
                        String potentialSourceURI = uri.replace("build/resources/main", ct);
                        try {
                            Path p = Paths.get(new URI(potentialSourceURI));
                            if (Files.exists(p)) {
                                return p;
                            }
                        } catch (URISyntaxException e) {
                            e.printStackTrace();
                        }
                    }
                } else if (uri.contains("build/resources/test")) {
                    String[] testClassesTransform = {
                            "src/test/java", "src/test/resources" };
                    for (String tct : testClassesTransform) {
                        String potentialSourceURI = uri.replace("build/resources/test", tct);
                        try {
                            Path p = Paths.get(new URI(potentialSourceURI));
                            if (Files.exists(p)) {
                                return p;
                            }
                        } catch (URISyntaxException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }

// Path: src/main/java/fr/brouillard/oss/cssfx/impl/log/CSSFXLogger.java
// public static Logger logger(String loggerName) {
//     if (!isInitialized()) {
//         noop();
//     }
//     return loggerFactory.getLogger(loggerName);
// }
// 
// Path: src/main/java/fr/brouillard/oss/cssfx/api/URIToPathConverter.java
// @FunctionalInterface
// public interface URIToPathConverter {
//     public Path convert(String uri);
// }


// Path: src/main/java/fr/brouillard/oss/cssfx/impl/URIToPathConverters.java
import fr.brouillard.oss.cssfx.api.URIToPathConverter;
import static fr.brouillard.oss.cssfx.impl.log.CSSFXLogger.logger;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

                    String[] classesTransform = {
                            "src/main/java", "src/main/resources" };
                    for (String ct : classesTransform) {
                        String potentialSourceURI = uri.replace("build/resources/main", ct);
                        try {
                            Path p = Paths.get(new URI(potentialSourceURI));
                            if (Files.exists(p)) {
                                return p;
                            }
                        } catch (URISyntaxException e) {
                            e.printStackTrace();
                        }
                    }
                } else if (uri.contains("build/resources/test")) {
                    String[] testClassesTransform = {
                            "src/test/java", "src/test/resources" };
                    for (String tct : testClassesTransform) {
                        String potentialSourceURI = uri.replace("build/resources/test", tct);
                        try {
                            Path p = Paths.get(new URI(potentialSourceURI));
                            if (Files.exists(p)) {
                                return p;
                            }
                        } catch (URISyntaxException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }

            logger(URIToPathConverters.class).debug("GRADLE converter failed to map css[%s] to a source file", uri);