Package railo.commons.io.res

Examples of railo.commons.io.res.Resource.lastModified()


    Resource res=cfc.getPageSource().getResource();
    if(res!=null){
      res=res.getParentResource().getRealResource(res.getName()+".hbm.xml");
      try{
        sb.append(CommonUtil.toString(res, CommonUtil.UTF8));
        return res.lastModified();
      }
      catch(Exception e){}
    }
    return 0;
  }
View Full Code Here


    Resource classFileOriginal = mapping.getClassRootDirectory().getRealResource(realOriginal.concat(".class"));
   
  // LOAD CLASS
      //print.out(className);
    // check last Mod
    if(classFile.lastModified()>=classFileOriginal.lastModified()) {
      try {
        Class clazz=cl.loadClass(className);
        if(clazz!=null && !hasChangesOfChildren(classFile.lastModified(),clazz))return registerTypeMapping(clazz);
      }
      catch(Throwable t){}
View Full Code Here

    java.lang.reflect.Method m = getComplexTypeMethod(clazz);
    if(m==null) return false;
    try {
      String path=Caster.toString(m.invoke(null, new Object[0]));
      Resource res = ResourceUtil.toResourceExisting(pc, path);
      if(last<res.lastModified()) {
        return true;
      }
    }
    catch (Exception e) {
      return true;
View Full Code Here

      String classNameOriginal=component.getPageSource().getFullClassName();
      String realOriginal=classNameOriginal.replace('.','/');
    Resource classFileOriginal = mapping.getClassRootDirectory().getRealResource(realOriginal.concat(".class"));

    // load existing class
    if(classFile.lastModified()>=classFileOriginal.lastModified()) {
      try {
        Class clazz=cl.loadClass(className);
        if(clazz!=null && !hasChangesOfChildren(classFile.lastModified(), clazz))return clazz;//ClassUtil.loadInstance(clazz);
      }
      catch(Throwable t){}
View Full Code Here

          print.e("mod:"+srcFile.lastModified());
        }
      }*/
     
     
    long srcLastModified = srcFile.lastModified();
        if(srcLastModified==0L) return null;
     
    // Page exists   
      if(page!=null) {
      //if(page!=null && !recompileAlways) {
View Full Code Here

    public static void checkForChangesInConfigFile(Config config) {
      ConfigImpl ci=(ConfigImpl) config;
    if(!ci.checkForChangesInConfigFile()) return;
   
    Resource file = config.getConfigFile();
    long diff=file.lastModified()-ci.lastModified();
    if(diff<10 && diff>-10) return;
    // reload
    try {
      ConfigWebAdmin admin = ConfigWebAdmin.newInstance(ci, null);
      admin.reload(ci, false);
View Full Code Here

    Struct sct=new StructImpl();

    sct.set("canRead", Caster.toBoolean(src.isReadable()));
    sct.set("canWrite", Caster.toBoolean(src.isWriteable()));
    sct.set("isHidden", Caster.toBoolean(src.getAttribute(Resource.ATTRIBUTE_HIDDEN)));
    sct.set("lastmodified",new DateTimeImpl(pc,src.lastModified(),false) );
    sct.set(KeyConstants._name,src.getName() );
    sct.set(KeyConstants._parent,src.getParent() );
    sct.set(KeyConstants._path,src.getAbsolutePath() );
    sct.set(KeyConstants._size, Caster.toDouble(src.length()));
    if(src.isDirectory())sct.set(KeyConstants._type, "directory");
View Full Code Here

    public static void reloadInstance(ConfigServerImpl configServer)
      throws SAXException, ClassException, PageException, IOException, TagLibException, FunctionLibException {
        Resource configFile=configServer.getConfigFile();
       
        if(configFile==null) return ;
        if(second(configServer.getLoadTime())>second(configFile.lastModified())) return ;
        boolean doNew=doNew(configServer.getConfigDir());
        load(configServer,loadDocument(configFile),true,doNew);
    }
   
    private static long second(long ms) {
View Full Code Here

    while(count>100000 || size>maxSize) {
      Resource[] files = filter==null?dir.listResources():dir.listResources(filter);
      if(len==files.length) break;// protect from inifinti loop
      len=files.length;
      for(int i=0;i<files.length;i++) {
        if(res==null || res.lastModified()>files[i].lastModified()) {
          res=files[i];
        }
      }
      if(res!=null) {
        size-=res.length();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.