Revision 14705 trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/wfs/wfs_1_0_0/WFSProtocolHandler1_0_0.java
WFSProtocolHandler1_0_0.java | ||
---|---|---|
13 | 13 |
import org.gvsig.remoteClient.gml.schemas.XMLElement; |
14 | 14 |
import org.gvsig.remoteClient.gml.schemas.XMLSchemaParser; |
15 | 15 |
import org.gvsig.remoteClient.utils.CapabilitiesTags; |
16 |
import org.gvsig.remoteClient.utils.EncodingXMLParser; |
|
16 | 17 |
import org.gvsig.remoteClient.wfs.WFSOperation; |
17 | 18 |
import org.gvsig.remoteClient.wfs.WFSProtocolHandler; |
18 | 19 |
import org.gvsig.remoteClient.wfs.exceptions.ExceptionsFactory; |
... | ... | |
108 | 109 |
} |
109 | 110 |
|
110 | 111 |
public boolean parseCapabilities(File f) { |
111 |
FileReader reader = null; |
|
112 |
try |
|
113 |
{ |
|
114 |
reader = new FileReader(f); |
|
115 |
BufferedReader br = new BufferedReader(reader); |
|
116 |
char[] buffer = new char[100]; |
|
117 |
br.read(buffer); |
|
118 |
StringBuffer st = new StringBuffer(new String(buffer)); |
|
119 |
String searchText = "encoding=\""; |
|
120 |
int index = st.indexOf(searchText); |
|
121 |
if (index>-1) { |
|
122 |
st.delete(0, index+searchText.length()); |
|
123 |
encoding = st.substring(0, st.indexOf("\"")); |
|
124 |
} |
|
125 |
} catch (FileNotFoundException ex) { |
|
126 |
ex.printStackTrace(); |
|
127 |
} catch (IOException e) { |
|
128 |
e.printStackTrace(); |
|
129 |
} |
|
130 |
|
|
131 | 112 |
int tag; |
132 |
KXmlParser parser = null;
|
|
133 |
parser = new KXmlParser();
|
|
134 |
try
|
|
135 |
{
|
|
136 |
parser.setInput(new FileInputStream(f), encoding);
|
|
137 |
parser.nextTag();
|
|
113 |
EncodingXMLParser parser = null;
|
|
114 |
parser = new EncodingXMLParser();
|
|
115 |
try
|
|
116 |
{
|
|
117 |
parser.setInput(f);
|
|
118 |
parser.nextTag();
|
|
138 | 119 |
|
139 | 120 |
if ( parser.getEventType() != KXmlParser.END_DOCUMENT ) |
140 | 121 |
{ |
Also available in: Unified diff