diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-03-31 20:57:55 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-03-31 20:57:55 -0700 |
commit | 25ac45d04a6c9a248d08b2c2952d6d04c482e15b (patch) | |
tree | c46d23fde504d97de93d19138d6049ceb98bc9ed /src/github/daneren2005 | |
parent | d66a640e877612589ef55be0d563b1abd0b5852c (diff) | |
download | dsub-25ac45d04a6c9a248d08b2c2952d6d04c482e15b.tar.gz dsub-25ac45d04a6c9a248d08b2c2952d6d04c482e15b.tar.bz2 dsub-25ac45d04a6c9a248d08b2c2952d6d04c482e15b.zip |
Fix samsung even allowing create temp on non-writable
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/util/FileUtil.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/util/FileUtil.java b/src/github/daneren2005/dsub/util/FileUtil.java index 3b45115b..4b425775 100644 --- a/src/github/daneren2005/dsub/util/FileUtil.java +++ b/src/github/daneren2005/dsub/util/FileUtil.java @@ -379,9 +379,13 @@ public class FileUtil { public static boolean verifyCanWrite(File dir) { if(ensureDirectoryExistsAndIsReadWritable(dir)) { try { - File tmp = File.createTempFile("tmp", "tmp", dir); - tmp.delete(); - return true; + File tmp = new File(dir, "tmp"); + if(tmp.createNewFile()) { + tmp.delete(); + return true; + } else { + return false; + } } catch(Exception e) { return false; } |