001 package railo.runtime.functions.file; 002 003 import java.io.File; 004 005 import railo.commons.io.res.Resource; 006 import railo.runtime.PageContext; 007 import railo.runtime.exp.FunctionException; 008 import railo.runtime.exp.PageException; 009 import railo.runtime.op.Caster; 010 011 public class GetTotalSpace { 012 public static double call(PageContext pc , Object obj) throws PageException { 013 Resource res=Caster.toResource(pc,obj, true, pc.getConfig().allowRealPath()); 014 if(!(res instanceof File)) throw new FunctionException(pc,"getTotalSpace",1,"filepath","this function is only supported for the local filesystem"); 015 File file=(File) res; 016 return file.getTotalSpace(); 017 } 018 }