1 4 package org.openedit.repository.filesystem; 5 6 import java.io.File ; 7 8 import com.openedit.util.FileUtils; 9 10 13 public class DirectoryTool 14 { 15 protected File fieldRootDirectory; 16 protected FileUtils fieldFileUtils = new FileUtils(); 17 18 public File getRootDirectory() 19 { 20 if ( fieldRootDirectory == null ) 21 { 22 String tempDir = System.getProperty( "java.io.tmpdir" ); 23 fieldRootDirectory = new File ( tempDir, "oe_version_test" ); getFileUtils().deleteAll( fieldRootDirectory ); 25 fieldRootDirectory.mkdir(); 26 } 27 return fieldRootDirectory; 28 } 29 30 public FileUtils getFileUtils() 31 { 32 return fieldFileUtils; 33 } 34 37 public void tearDown() throws Exception 38 { 39 getFileUtils().deleteAll( getRootDirectory() ); 40 } 41 } 42 | Popular Tags |