| 1 | |
package org.codeforamerica.open311.facade; |
| 2 | |
|
| 3 | |
import java.net.URL; |
| 4 | |
import java.util.Map; |
| 5 | |
|
| 6 | |
import org.codeforamerica.open311.facade.exceptions.APIWrapperException; |
| 7 | |
import org.codeforamerica.open311.internals.caching.Cache; |
| 8 | |
import org.codeforamerica.open311.internals.network.NetworkManager; |
| 9 | |
import org.codeforamerica.open311.internals.parsing.DataParser; |
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
public class InvalidXMLWrapper extends APIWrapper { |
| 19 | |
|
| 20 | |
InvalidXMLWrapper(String endpointUrl, Format format, EndpointType type, |
| 21 | |
DataParser dataParser, NetworkManager networkManager, Cache cache, |
| 22 | |
String jurisdictionId, String apiKey) { |
| 23 | 0 | super(endpointUrl, format, type, dataParser, networkManager, cache, |
| 24 | |
jurisdictionId, apiKey); |
| 25 | 0 | } |
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
@Override |
| 32 | |
protected String networkGet(URL url) throws APIWrapperException { |
| 33 | 0 | return sanitizeOutput(super.networkGet(url)); |
| 34 | |
} |
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
@Override |
| 41 | |
protected String networkPost(URL url, Map<String, String> parameters) |
| 42 | |
throws APIWrapperException { |
| 43 | 0 | return sanitizeOutput(super.networkPost(url, parameters)); |
| 44 | |
} |
| 45 | |
|
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | |
|
| 51 | |
|
| 52 | |
|
| 53 | |
private String sanitizeOutput(String response) { |
| 54 | 0 | return response.replace("\u0010", ""); |
| 55 | |
} |
| 56 | |
|
| 57 | |
} |