@@ -27,13 +27,15 @@ public class EssentialAPI {
2727 private static final String USER_AGENT = "EssentialAd/" + EssentialAdLoader .OUR_VERSION + " (" + EssentialAdLoader .OUR_PKG + ")" ;
2828
2929 private static final Path API_OVERRIDE_FILE = AdConfig .CONFIG_FOLDER .resolve ("data.override.json" );
30- private static final Path MODAL_OVERRIDE_FILE = AdConfig .CONFIG_FOLDER .resolve ("mod-partner-modal-metadata.json" );
30+ private static final Path MODAL_OVERRIDE_FOLDER = AdConfig .CONFIG_FOLDER .resolve ("override" );
31+ private static final Path MODAL_OVERRIDE_FILE = MODAL_OVERRIDE_FOLDER .resolve ("mod-partner-modal-metadata.json" );
3132
3233 public static CompletableFuture <AdData > fetchAdData () {
3334 CompletableFuture <AdData > future = new CompletableFuture <>();
3435 CompletableFuture .runAsync (() -> {
3536 try {
3637 if (Files .exists (API_OVERRIDE_FILE )) {
38+ EssentialAd .LOGGER .info ("Using API override file" );
3739 try (BufferedReader reader = Files .newBufferedReader (API_OVERRIDE_FILE )) {
3840 AdData data = EssentialAd .GSON .fromJson (reader , AdData .class );
3941 future .complete (data );
@@ -56,11 +58,12 @@ public static CompletableFuture<AdData> fetchAdData() {
5658 AdData data = EssentialAd .GSON .fromJson (response , AdData .class );
5759
5860 if (Files .exists (MODAL_OVERRIDE_FILE )) {
61+ EssentialAd .LOGGER .info ("Using modal override file" );
5962 try (BufferedReader reader = Files .newBufferedReader (MODAL_OVERRIDE_FILE )) {
6063 ModalData modalData = EssentialAd .GSON .fromJson (reader , ModalData .class );
6164 // Replace image paths with base64 representation
6265 for (ModalData .Feature feature : modalData .getFeatures ()) {
63- Path iconPath = AdConfig . CONFIG_FOLDER .resolve (feature .getIcon ());
66+ Path iconPath = MODAL_OVERRIDE_FOLDER .resolve (feature .getIcon ());
6467 try {
6568 byte [] bytes = Files .readAllBytes (iconPath );
6669 String base64 = Base64 .getEncoder ().encodeToString (bytes );
0 commit comments