1 5 package org.prevayler.foundation; 6 7 import java.io.*; 8 9 public class FileManager { 10 11 static public File produceDirectory(String directoryName) throws IOException { 12 File directory = new File(directoryName); 13 if (!directory.exists() && !directory.mkdirs()) throw new IOException("Directory doesn't exist and could not be created: " + directoryName); 14 if (!directory.isDirectory()) throw new IOException("Path exists but is not a directory: " + directoryName); 15 return directory; 16 } 17 } 18 | Popular Tags |