svn-gvsig-desktop / tags / v1_0_2_Build_911 / libraries / libRemoteServices / src / org / gvsig / remoteClient / OGCProtocolHandler.java @ 11388
History | View | Annotate | Download (3.59 KB)
1 | 3483 | jaume | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
|
||
4 | *
|
||
5 | * This program is free software; you can redistribute it and/or
|
||
6 | * modify it under the terms of the GNU General Public License
|
||
7 | * as published by the Free Software Foundation; either version 2
|
||
8 | * of the License, or (at your option) any later version.
|
||
9 | *
|
||
10 | * This program is distributed in the hope that it will be useful,
|
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | * GNU General Public License for more details.
|
||
14 | *
|
||
15 | * You should have received a copy of the GNU General Public License
|
||
16 | * along with this program; if not, write to the Free Software
|
||
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
18 | *
|
||
19 | * For more information, contact:
|
||
20 | *
|
||
21 | * Generalitat Valenciana
|
||
22 | * Conselleria d'Infraestructures i Transport
|
||
23 | * Av. Blasco Ib??ez, 50
|
||
24 | * 46010 VALENCIA
|
||
25 | * SPAIN
|
||
26 | *
|
||
27 | * +34 963862235
|
||
28 | * gvsig@gva.es
|
||
29 | * www.gvsig.gva.es
|
||
30 | *
|
||
31 | * or
|
||
32 | *
|
||
33 | * IVER T.I. S.A
|
||
34 | * Salamanca 50
|
||
35 | * 46005 Valencia
|
||
36 | * Spain
|
||
37 | *
|
||
38 | * +34 963163400
|
||
39 | * dac@iver.es
|
||
40 | */
|
||
41 | package org.gvsig.remoteClient; |
||
42 | |||
43 | import java.io.File; |
||
44 | |||
45 | public abstract class OGCProtocolHandler { |
||
46 | /**
|
||
47 | * procotol handler name
|
||
48 | */
|
||
49 | protected String name; |
||
50 | /**
|
||
51 | * protocol handler version
|
||
52 | */
|
||
53 | protected String version; |
||
54 | /**
|
||
55 | * host of the WMS to connect
|
||
56 | */
|
||
57 | protected String host; |
||
58 | /**
|
||
59 | * port number of the comunication channel of the WMS to connect
|
||
60 | */
|
||
61 | protected String port; |
||
62 | |||
63 | /**
|
||
64 | * @return Returns the host.
|
||
65 | */
|
||
66 | public String getHost() { |
||
67 | return host;
|
||
68 | } |
||
69 | /**
|
||
70 | * @param host The host to set.
|
||
71 | */
|
||
72 | public void setHost(String host) { |
||
73 | this.host = host;
|
||
74 | } |
||
75 | /**
|
||
76 | * @return Returns the name.
|
||
77 | */
|
||
78 | public String getName() { |
||
79 | return name;
|
||
80 | } |
||
81 | /**
|
||
82 | * @param name The name to set.
|
||
83 | */
|
||
84 | public void setName(String name) { |
||
85 | this.name = name;
|
||
86 | } |
||
87 | /**
|
||
88 | * @return Returns the port.
|
||
89 | */
|
||
90 | public String getPort() { |
||
91 | return port;
|
||
92 | } |
||
93 | /**
|
||
94 | * @param port The port to set.
|
||
95 | */
|
||
96 | public void setPort(String port) { |
||
97 | this.port = port;
|
||
98 | } |
||
99 | /**
|
||
100 | * @return Returns the version.
|
||
101 | */
|
||
102 | public String getVersion() { |
||
103 | return version;
|
||
104 | } |
||
105 | /**
|
||
106 | * @param version The version to set.
|
||
107 | */
|
||
108 | public void setVersion(String version) { |
||
109 | this.version = version;
|
||
110 | } |
||
111 | |||
112 | 4427 | jaume | // /**
|
113 | // * @deprectated
|
||
114 | // * (temporarily)
|
||
115 | // */
|
||
116 | // protected File downloadFile(URL url, String fileName) throws IOException,ConnectException, UnknownHostException{
|
||
117 | // File f = null;
|
||
118 | //
|
||
119 | // try{
|
||
120 | // f = TempFileManager.createTempFile(fileName, "tmp");
|
||
121 | // System.out.println("downloading '"+url.toString()+"' to: "+f.getAbsolutePath());
|
||
122 | //
|
||
123 | // f.deleteOnExit();
|
||
124 | //
|
||
125 | // } catch (IOException io) {
|
||
126 | // io.printStackTrace();
|
||
127 | // }
|
||
128 | // DataOutputStream dos = new DataOutputStream( new BufferedOutputStream(new FileOutputStream(f)));
|
||
129 | // byte[] buffer = new byte[1024*256];
|
||
130 | // InputStream is = url.openStream();
|
||
131 | // long readed = 0;
|
||
132 | // for (int i = is.read(buffer); i>0; i = is.read(buffer)){
|
||
133 | // dos.write(buffer, 0, i);
|
||
134 | // readed += i;
|
||
135 | // }
|
||
136 | // dos.close();
|
||
137 | // /*if (!isNotAnException(f))
|
||
138 | // // SI que es una excepci?n
|
||
139 | // throw new ServerErrorResponseException();*/
|
||
140 | // return f;
|
||
141 | // }
|
||
142 | 3483 | jaume | |
143 | |||
144 | /**
|
||
145 | * parses the data retrieved by the Capabilities XML document
|
||
146 | *
|
||
147 | */
|
||
148 | 4222 | jaume | public abstract boolean parseCapabilities(File f); |
149 | 3483 | jaume | |
150 | } |