1 17 18 19 20 package org.apache.lenya.cms.publishing; 21 22 import java.io.File ; 23 import java.io.FileNotFoundException ; 24 import java.io.IOException ; 25 26 27 30 public abstract class AbstractFilePublisher extends AbstractPublisher { 31 40 protected void copyFile(File source, File destination) 41 throws IOException , FileNotFoundException { 42 if (!source.exists()) { 43 throw new FileNotFoundException (); 44 } 45 46 File parentDestination = new File (destination.getParent()); 47 48 if (!parentDestination.exists()) { 49 parentDestination.mkdirs(); 50 } 51 52 org.apache.avalon.excalibur.io.FileUtil.copyFile(source, destination); 53 } 54 } 55 | Popular Tags |