2024-12-02 10:07:16 +00:00

26 lines
690 B
Java

package eirb.pg203.weather.fakeJSONFetcher;
import eirb.pg203.weather.utils.FileResourcesUtils;
import eirb.pg203.weather.utils.JSONFetcher;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.IOException;
import java.net.URL;
public class FakeJSONFetcherOpenMeteo extends JSONFetcher {
private JSONObject responseExample() {
return FileResourcesUtils.getFileFromResourceAsJson("OpenMeteo/Bordeaux-partial-cloudy-rain-sunny.json");
}
@Override
public JSONObject fetch(URL url) throws IOException {
return responseExample();
}
@Override
public JSONArray fetchArray(URL url) throws IOException {
return null;
}
}