Author: dkulp
Date: Wed Dec 15 04:55:14 2010
New Revision: 1049426
URL: http://svn.apache.org/viewvc?rev=1049426&view=rev
Log:
[CXF-1924] make sure the tmp dir is writable as well
Modified:
cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
Modified:
cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java?rev=1049426&r1=1049425&r2=1049426&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
(original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
Wed Dec 15 04:55:14 2010
@@ -64,12 +64,18 @@ public final class FileUtils {
int x = (int)(Math.random() * 1000000);
s = System.getProperty("java.io.tmpdir");
File checkExists = new File(s);
- if (!checkExists.exists()) {
+ if (!checkExists.exists() || !checkExists.isDirectory()) {
throw new RuntimeException("The directory "
+ checkExists.getAbsolutePath()
+ " does not exist, please set
java.io.tempdir"
+ " to an existing directory");
}
+ if (!checkExists.canWrite()) {
+ throw new RuntimeException("The directory "
+ + checkExists.getAbsolutePath()
+ + " is now writable, please set
java.io.tempdir"
+ + " to an writable directory");
+ }
File f = new File(s, "cxf-tmp-" + x);
while (!f.mkdir()) {
x = (int)(Math.random() * 1000000);