diff 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
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Fri Aug 05 10:03:56 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Mon Aug 08 17:06:17 2011 +0200
@@ -281,9 +281,22 @@
 				" Setting to \"sde\" as default.");
 		    database_auth = "sde";
 		}
+
+		String port = layerElement.getAttribute("instance");
+                StringBuffer strBuff = new StringBuffer();
+                char c;
+    
+                for (int j = 0; j < port.length() ; j++) {
+                    c = port.charAt(j);
+        
+                    if(Character.isDigit(c)) {
+                        strBuff.append(c);
+                    }
+                }
+		
                 layer.setConnection(
                 layerElement.getAttribute("server") + "," +
-                    "port:" + layerElement.getAttribute("instance") + "," +
+                    "port:" + strBuff.toString() + "," +
                 database_auth + "," +
                 layerElement.getAttribute("user") + ",<PASSWORD>");
                 layer.setData(
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)