26 lines
690 B
Java
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;
|
|
}
|
|
}
|