[Schmitzm-commits] r1550 - in trunk: schmitzm-core/src/main/java/de/schmitzm/io schmitzm-gt/src/main/java/de/schmitzm/geotools/feature
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Apr 6 10:51:44 CEST 2011
Author: alfonx
Date: 2011-04-06 10:51:43 +0200 (Wed, 06 Apr 2011)
New Revision: 1550
Modified:
trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java
trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/FeatureUtil.java
Log:
Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java 2011-04-05 14:13:22 UTC (rev 1549)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java 2011-04-06 08:51:43 UTC (rev 1550)
@@ -51,7 +51,6 @@
import java.net.URL;
import java.net.URLConnection;
import java.net.URLDecoder;
-import java.net.URLEncoder;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
import java.security.MessageDigest;
@@ -1136,14 +1135,22 @@
/**
* Bereinigt Pfadangaben, z.b. "C:\Programme" zu "C:\\Programme" und
* "Eigene%20Dateien" zu "Eigene Dateien". Liefert einen leeren String wenn
- * <code>null</code> übergeben wurde.
+ * <code>null</code> übergeben wurde.<br/>
+ * Sollte vor jeder GUI-Ausgabe eines potentiellen Windows-Pfad verwendet
+ * werden.
*/
public static String escapePath(String path) {
if (path == null)
return "";
path = path.replace("\\", "\\\\");
- path = path.replace("%20", " ");
+ // path = path.replace("%20", " ");
+ if (path.contains("%20"))
+ try {
+ path = URLDecoder.decode(path, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
return path;
}
Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/FeatureUtil.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/FeatureUtil.java 2011-04-05 14:13:22 UTC (rev 1549)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/FeatureUtil.java 2011-04-06 08:51:43 UTC (rev 1550)
@@ -2111,9 +2111,11 @@
values = getDefaultAttributeValues(schema);
try {
-
- if (schema.getGeometryDescriptor().getType().getBinding() == Geometry.class
- .getClass()) {
+ final GeometryDescriptor geometryDescriptor = schema
+ .getGeometryDescriptor();
+ final GeometryType type = geometryDescriptor.getType();
+ final Class<?> binding = type.getBinding();
+ if (binding == Geometry.class.getClass()) {
// When parsing GML it can be all mixed.
LOGGER.info("This is "
+ schema.getGeometryDescriptor().getType().getBinding());
More information about the Schmitzm-commits
mailing list