001    package railo.runtime.type.scope.client;
002    
003    import railo.commons.io.log.Log;
004    import railo.commons.io.res.Resource;
005    import railo.runtime.PageContext;
006    import railo.runtime.type.Collection;
007    import railo.runtime.type.Struct;
008    import railo.runtime.type.scope.ClientPlus;
009    import railo.runtime.type.scope.storage.StorageScopeFile;
010    
011    public class ClientFile extends StorageScopeFile implements ClientPlus {
012    
013            
014            /**
015             * Constructor of the class
016             * @param pc
017             * @param name
018             * @param sct
019             */
020            private ClientFile(PageContext pc,Resource res,Struct sct) {
021                    super(pc,res,"client",SCOPE_CLIENT,sct);
022            }
023            
024    
025            /**
026             * Constructor of the class, clone existing
027             * @param other
028             */
029            private ClientFile(ClientFile other,boolean deepCopy) {
030                    super(other,deepCopy);
031            }
032    
033            /**
034             * load new instance of the class
035             * @param name
036             * @param pc
037             * @param log 
038             * @return
039             */
040            public static ClientPlus getInstance(String name, PageContext pc, Log log) {
041    
042                    Resource res=_loadResource(pc.getConfig(),SCOPE_CLIENT,name,pc.getCFID());
043                    Struct data=_loadData(pc,res,log);
044                    return new ClientFile(pc,res,data);
045            }
046            
047            /**
048             *
049             * @see railo.runtime.type.Collection#duplicate(boolean)
050             */
051            public Collection duplicate(boolean deepCopy) {
052            return new ClientFile(this,deepCopy);
053            }
054    }