Revision 41817 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.remoteclient/src/main/java/org/gvsig/remoteclient/wms/WMSProtocolHandlerFactory.java
WMSProtocolHandlerFactory.java | ||
---|---|---|
29 | 29 |
import java.io.StringReader; |
30 | 30 |
import java.net.ConnectException; |
31 | 31 |
import java.net.URL; |
32 |
import java.net.URLConnection; |
|
32 | 33 |
import java.util.ArrayList; |
33 | 34 |
import java.util.Iterator; |
34 | 35 |
|
36 |
import org.gvsig.remoteclient.utils.CapabilitiesTags; |
|
35 | 37 |
import org.kxml2.io.KXmlParser; |
36 |
import org.xmlpull.v1.XmlPullParserException; |
|
37 |
|
|
38 |
import org.gvsig.remoteclient.utils.CapabilitiesTags; |
|
39 | 38 |
import org.slf4j.Logger; |
40 | 39 |
import org.slf4j.LoggerFactory; |
40 |
import org.xmlpull.v1.XmlPullParserException; |
|
41 | 41 |
|
42 | 42 |
public class WMSProtocolHandlerFactory { |
43 | 43 |
|
... | ... | |
195 | 195 |
String request = WMSProtocolHandler.buildCapabilitiesSuitableVersionRequest(host, _version); |
196 | 196 |
String version = new String(); |
197 | 197 |
StringReader reader = null; |
198 |
//InputStreamReader reader; |
|
199 |
//InputStream is = null; |
|
200 | 198 |
DataInputStream dis = null; |
201 | 199 |
try |
202 | 200 |
{ |
203 | 201 |
URL url = new URL(request); |
204 | 202 |
byte[] buffer = new byte[size]; |
205 |
dis = new DataInputStream(url.openStream()); |
|
206 |
dis.readFully(buffer); |
|
203 |
URLConnection conn = url.openConnection(); |
|
204 |
conn.setRequestProperty("Accept", "text/xml, text/*, */*"); |
|
205 |
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (gvSIG) like Gecko"); |
|
206 |
dis = new DataInputStream(conn.getInputStream()); |
|
207 |
dis.read(buffer); |
|
207 | 208 |
String string = new String(buffer); |
208 | 209 |
|
209 | 210 |
// patch for ArcIMS + WMS connector > 9.0 bug |
Also available in: Unified diff