wms-remote-client.patch
org.gvsig.desktop.compat.cdc/org.gvsig.compat/org.gvsig.compat.se/src/main/java/org/gvsig/compat/se/net/downloader/se/SEDownloaderTask.java (copia de trabajo) | ||
---|---|---|
11 | 11 |
import java.security.KeyManagementException; |
12 | 12 |
import java.security.NoSuchAlgorithmException; |
13 | 13 |
import java.util.prefs.Preferences; |
14 | ||
14 | 15 |
import javax.net.ssl.HttpsURLConnection; |
15 | 16 |
import javax.net.ssl.SSLContext; |
16 | 17 |
import javax.net.ssl.TrustManager; |
17 | 18 |
import javax.net.ssl.X509TrustManager; |
19 | ||
18 | 20 |
import org.gvsig.compat.se.net.downloader.Downloader; |
19 | 21 |
import org.slf4j.Logger; |
20 | 22 |
import org.slf4j.LoggerFactory; |
... | ... | |
58 | 60 |
} |
59 | 61 |
connection = (HttpURLConnection) url.openConnection(); |
60 | 62 |
connection.setUseCaches(false); |
63 |
connection.setRequestProperty("User-Agent", "Mozilla/5.0 (gvSIG) like Gecko"); |
|
61 | 64 |
connection.setConnectTimeout(timeout); |
62 | 65 |
//If it uses a HTTP POST |
63 | 66 |
if (data != null) { |
... | ... | |
70 | 73 |
os.flush(); |
71 | 74 |
is = new DataInputStream(connection.getInputStream()); |
72 | 75 |
} else { |
73 |
is = new DataInputStream(url.openStream());
|
|
76 |
is = new DataInputStream(connection.getInputStream());
|
|
74 | 77 |
} |
75 | 78 | |
76 | 79 |
dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(dstFile))); |
org.gvsig.desktop.compat.cdc/org.gvsig.remoteclient/src/main/java/org/gvsig/remoteclient/wms/WMSProtocolHandlerFactory.java (copia de trabajo) | ||
---|---|---|
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 |