Fix for Matt: For Mac OS 10.6 temporary directories replace paths like '/var/folders/Ax/AxRUoz51Fh05fVe-j6C1Wk+++TI/-Tmp-/' with '/tmp/' so that google reflections 0.95RC2 still works on classes in the directory.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4316 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
kshakir 2010-09-20 22:02:07 +00:00
parent 205fc0b636
commit f9707bb7bf
1 changed files with 5 additions and 0 deletions

View File

@ -62,6 +62,11 @@ object IOUtils {
* @throws IOException if the directory could not be created.
*/
def tempDir(prefix: String, suffix: String = "") = {
// Keep the temp directory from having pluses in it, which can cause problems with the Google Reflections library.
// see also: http://benjchristensen.com/2009/09/22/mac-osx-10-6-java-java-io-tmpdir/
if (System.getProperty("java.io.tmpdir").startsWith("/var/folders/"))
System.setProperty("java.io.tmpdir", "/tmp/");
val tempDirParent = new File(System.getProperty("java.io.tmpdir"))
if (!tempDirParent.exists && !tempDirParent.mkdirs)
throw new IOException("Could not create temp directory: " + tempDirParent)