[Schmitzm-commits] r1154 - trunk/src/schmitzm/geotools/io

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Oct 20 12:13:44 CEST 2010


Author: alfonx
Date: 2010-10-20 12:13:44 +0200 (Wed, 20 Oct 2010)
New Revision: 1154

Modified:
   trunk/src/schmitzm/geotools/io/GeoImportUtil.java
Log:


Modified: trunk/src/schmitzm/geotools/io/GeoImportUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/io/GeoImportUtil.java	2010-10-20 08:39:36 UTC (rev 1153)
+++ trunk/src/schmitzm/geotools/io/GeoImportUtil.java	2010-10-20 10:13:44 UTC (rev 1154)
@@ -401,8 +401,12 @@
 		// DataStore dataStore = new ShapefileDataStore(shpURL);
 		LOGGER.debug("DataStore = " + dataStore.getClass().toString());
 		IndexedShapefileDataStore dataStoreIndex = (IndexedShapefileDataStore) dataStore;
-		LOGGER.debug("indexed = " + dataStoreIndex.isIndexed());
-		LOGGER.debug("memory = " + dataStoreIndex.isMemoryMapped());
+		try {
+			LOGGER.debug("indexed = " + dataStoreIndex.isIndexed());
+			LOGGER.debug("memory = " + dataStoreIndex.isMemoryMapped());
+		} catch (Exception e) {
+			System.err.println(e);
+		}
 
 		return dataStore;
 	}
@@ -1061,8 +1065,7 @@
 				StringTokenizer st = new StringTokenizer(line);
 				tfwValues.add(Double.parseDouble(st.nextToken(" \n;,#|/")));
 			} catch (Exception err) {
-				LOGGER.error("WorldFile-Error in line " + lineNo + ": "
-						+ err);
+				LOGGER.error("WorldFile-Error in line " + lineNo + ": " + err);
 
 				LOGGER.error("   >> expected value is set to 1.0");
 				tfwValues.add(1.0);
@@ -1374,7 +1377,9 @@
 	 * The URLs where a <code>.cpg</code> or <code>.cst</code> file describing
 	 * the {@link Charset} could be found.
 	 * 
-	 * @param url_ must be an {@link URL} with an extension. The extensions will then the changed for possible charset containing extensions. 
+	 * @param url_
+	 *            must be an {@link URL} with an extension. The extensions will
+	 *            then the changed for possible charset containing extensions.
 	 */
 	public static URL[] getCharsetUrls(URL url_) {
 		return new URL[] { IOUtil.changeUrlExt(url_, "cpg"),
@@ -1384,24 +1389,24 @@
 	}
 
 	/**
-	 * Tries to read a file containing {@link Charset} information next to a {@link URL}.
+	 * Tries to read a file containing {@link Charset} information next to a
+	 * {@link URL}.
 	 * 
 	 * @return <code>null</code> is nothing found.
 	 */
 	public static Charset readCharset(URL url) {
-		URL[] cpgUrls = GeoImportUtil.getCharsetUrls( url);
+		URL[] cpgUrls = GeoImportUtil.getCharsetUrls(url);
 		for (URL cpgUrl : cpgUrls) {
 			try {
 				String charsetName = IOUtil.readURLasString(cpgUrl);
 
 				if (charsetName.equals(""))
 					continue;
-				
+
 				return Charset.forName(charsetName);
 
-			} 
-			catch (Exception e) {
-//					 LOGGER.warn("Reading .cpg file failed for "+cpgUrl+". Using default. ");
+			} catch (Exception e) {
+				// LOGGER.warn("Reading .cpg file failed for "+cpgUrl+". Using default. ");
 			}
 		}
 		return null;



More information about the Schmitzm-commits mailing list