001 package railo.runtime.functions.file; 002 003 import railo.commons.io.res.Resource; 004 import railo.runtime.PageContext; 005 import railo.runtime.exp.FunctionException; 006 import railo.runtime.exp.PageException; 007 import railo.runtime.op.Caster; 008 import railo.runtime.tag.FileTag; 009 010 public class FileCopy { 011 012 public static String call(PageContext pc, Object oSrc, Object oDst) throws PageException { 013 Resource src = Caster.toResource(oSrc,false); 014 if(!src.exists()) 015 throw new FunctionException(pc,"FileCopy",1,"source", 016 "source file ["+src+"] does not exists"); 017 018 FileTag.actionCopy(pc, pc.getConfig().getSecurityManager(), 019 src, Caster.toString(oDst), 020 FileTag.NAMECONFLICT_UNDEFINED, null, null, -1, null); 021 022 return null; 023 } 024 }