1 4 package com.tctest.spring.integrationtests.framework; 5 6 import com.tc.exception.TCRuntimeException; 7 import com.tc.test.TempDirectoryHelper; 8 import com.tctest.spring.integrationtests.framework.PropertiesHackForRunningInEclipse; 9 10 import java.io.File ; 11 import java.io.IOException ; 12 13 public class TempDirectoryUtil { 14 15 private static TempDirectoryHelper tempDirectoryHelper; 16 17 public static File getTempDirectory(Class type) throws IOException { 18 return getTempDirectoryHelper(type).getDirectory(); 19 } 20 21 protected static synchronized TempDirectoryHelper getTempDirectoryHelper(Class type) { 22 if (tempDirectoryHelper == null) { 23 try { 24 PropertiesHackForRunningInEclipse.initializePropertiesWhenRunningInEclipse(); 25 tempDirectoryHelper = new TempDirectoryHelper(type, true); 26 } catch (IOException ioe) { 27 throw new TCRuntimeException("Can't get configuration for temp directory", ioe); 28 } 29 } 30 31 return tempDirectoryHelper; 32 } 33 34 } 35 | Popular Tags |