[Schmitzm-commits] r389 - branches/1.0-gt2-2.6/src/schmitzm/geotools/styling

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Sep 13 10:37:27 CEST 2009


Author: alfonx
Date: 2009-09-13 10:37:26 +0200 (Sun, 13 Sep 2009)
New Revision: 389

Modified:
   branches/1.0-gt2-2.6/src/schmitzm/geotools/styling/StylingUtil.java
Log:
* After reading a Style from URL we have to close the Stream in a finally block.

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/styling/StylingUtil.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/styling/StylingUtil.java	2009-09-11 19:06:17 UTC (rev 388)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/styling/StylingUtil.java	2009-09-13 08:37:26 UTC (rev 389)
@@ -57,6 +57,7 @@
 import javax.swing.JLabel;
 import javax.xml.transform.TransformerException;
 
+import org.apache.commons.io.IOUtils;
 import org.apache.log4j.Logger;
 import org.geotools.brewer.color.BrewerPalette;
 import org.geotools.brewer.color.PaletteSuitability;
@@ -982,12 +983,14 @@
 	 *         Kr&uuml;ger</a>
 	 */
 	public static Style[] loadSLD(URL url) {
-		// LOGGER.debug("Loading styles from URL...");
+		InputStream openStream = null;
 		try {
-			final InputStream openStream = url.openStream();
+			openStream = url.openStream();
 			return loadSLD(openStream);
 		} catch (IOException e) {
 			return null;
+		} finally {
+			IOUtils.closeQuietly(openStream);
 		}
 	}
 



More information about the Schmitzm-commits mailing list