[Schmitzm-commits] r1064 - trunk/src/schmitzm/io

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sat Sep 25 19:07:48 CEST 2010


Author: alfonx
Date: 2010-09-25 19:07:47 +0200 (Sat, 25 Sep 2010)
New Revision: 1064

Modified:
   trunk/src/schmitzm/io/IOUtil.java
Log:
Improved temp path fallbacks if the temp dir can not be found

Modified: trunk/src/schmitzm/io/IOUtil.java
===================================================================
--- trunk/src/schmitzm/io/IOUtil.java	2010-09-25 17:07:25 UTC (rev 1063)
+++ trunk/src/schmitzm/io/IOUtil.java	2010-09-25 17:07:47 UTC (rev 1064)
@@ -39,6 +39,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 
+import org.apache.commons.lang.SystemUtils;
 import org.apache.log4j.Logger;
 import org.geotools.data.DataUtilities;
 
@@ -659,8 +660,13 @@
 
 			if (tempPath == null || tempPath.isEmpty()
 					|| !new File(tempPath).exists()) {
-				LOGGER.warn("Temporary directory can't be found. Using /tmp");
-				tempPath = "/tmp";
+				
+				if (SystemUtils.IS_OS_WINDOWS) {
+					tempPath = "C:\tmp";
+				} else {
+					tempPath = "/tmp";
+				}
+				LOGGER.warn("Temporary directory can't be found. Using '"+tempPath+"'");
 			}
 
 			while (tempPath.endsWith(File.separator))



More information about the Schmitzm-commits mailing list