1 package org.apache.velocity.texen.util; 2 3 18 19 import java.io.File ; 20 21 28 public class FileUtil 29 { 30 36 static public String mkdir (String s) 37 { 38 try 39 { 40 if ((new File (s)).mkdirs()) 41 return "Created dir: "+s; 42 else 43 return "Failed to create dir or dir already exists: "+s; 44 } 45 catch (Exception e) 46 { 47 return e.toString(); 48 } 49 } 50 51 57 public static File file(String s) 58 { 59 File f = new File (s); 60 return f; 61 } 62 63 70 public static File file(String base, String s) 71 { 72 File f = new File (base, s); 73 return f; 74 } 75 } 76 | Popular Tags |