comparison src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 238:e672f5134d6e

Remove all non numeric chars from port string.
author raimund renkert <raimund.renkert@intevation.de>
date Mon, 08 Aug 2011 17:06:17 +0200
parents 448a2fd085e0
children 8aefef8a1626
comparison
equal deleted inserted replaced
237:4f6356a908e1 238:e672f5134d6e
279 if (database_auth.equals("") || database_auth == null) { 279 if (database_auth.equals("") || database_auth == null) {
280 logger.warn("Could not set the database connection user." + 280 logger.warn("Could not set the database connection user." +
281 " Setting to \"sde\" as default."); 281 " Setting to \"sde\" as default.");
282 database_auth = "sde"; 282 database_auth = "sde";
283 } 283 }
284
285 String port = layerElement.getAttribute("instance");
286 StringBuffer strBuff = new StringBuffer();
287 char c;
288
289 for (int j = 0; j < port.length() ; j++) {
290 c = port.charAt(j);
291
292 if(Character.isDigit(c)) {
293 strBuff.append(c);
294 }
295 }
296
284 layer.setConnection( 297 layer.setConnection(
285 layerElement.getAttribute("server") + "," + 298 layerElement.getAttribute("server") + "," +
286 "port:" + layerElement.getAttribute("instance") + "," + 299 "port:" + strBuff.toString() + "," +
287 database_auth + "," + 300 database_auth + "," +
288 layerElement.getAttribute("user") + ",<PASSWORD>"); 301 layerElement.getAttribute("user") + ",<PASSWORD>");
289 layer.setData( 302 layer.setData(
290 layerElement.getAttribute("data_source") + 303 layerElement.getAttribute("data_source") +
291 ",SHAPE," + 304 ",SHAPE," +
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)