From f9707bb7bf527ca2a76aadd2f7a08dfaf0b6197b Mon Sep 17 00:00:00 2001 From: kshakir Date: Mon, 20 Sep 2010 22:02:07 +0000 Subject: [PATCH] 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 --- scala/src/org/broadinstitute/sting/queue/util/IOUtils.scala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scala/src/org/broadinstitute/sting/queue/util/IOUtils.scala b/scala/src/org/broadinstitute/sting/queue/util/IOUtils.scala index 95965615b..167f61761 100644 --- a/scala/src/org/broadinstitute/sting/queue/util/IOUtils.scala +++ b/scala/src/org/broadinstitute/sting/queue/util/IOUtils.scala @@ -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)