Package railo.commons.io.res

Examples of railo.commons.io.res.Resource


    removeLD(config.getTldFile(),name);
  }
 
  public void removeTLDs(String[] names) throws IOException {
    if(ArrayUtil.isEmpty(names)) return;
    Resource file = config.getTldFile();
    for(int i=0;i<names.length;i++){
      removeLD(file,names[i]);
    }
  }
View Full Code Here


    }
  }

  public void removeFLDs(String[] names) throws IOException {
    if(ArrayUtil.isEmpty(names)) return;
    Resource file = config.getFldFile();
    for(int i=0;i<names.length;i++){
      removeLD(file,names[i]);
    }
  }
View Full Code Here

  public void updateJar(Resource resJar) throws IOException {
    updateJar(config, resJar);
  }
  private static void updateJar(Config config, Resource resJar) throws IOException {
    Resource lib = config.getConfigDir().getRealResource("lib");
    if(!lib.exists())lib.mkdir();
     
    Resource fileLib = lib.getRealResource(resJar.getName());
   
    if(fileLib.length()!=resJar.length()){
      IOUtil.closeEL(config.getClassLoader());
      ResourceUtil.copy(resJar, fileLib);
      ConfigWebFactory.reloadLib((ConfigImpl) config);
    }
  }
View Full Code Here

      ConfigWebFactory.reloadLib((ConfigImpl) config);
    }
  }
 
  static void updateJar(Config config, InputStream is, String name,boolean closeStream) throws IOException {
    Resource lib = config.getConfigDir().getRealResource("lib");
    if(!lib.exists())lib.mkdir();
     
    Resource fileLib = lib.getRealResource(name);
   
    IOUtil.closeEL(config.getClassLoader());
    IOUtil.copy(is, fileLib.getOutputStream(), closeStream, true);
    ConfigWebFactory.reloadLib((ConfigImpl) config);
  }
View Full Code Here

  }
  public void removeJar(String[] names) throws IOException {
    if(ArrayUtil.isEmpty(names)) return;
   
   
    Resource lib = config.getConfigDir().getRealResource("lib");
    boolean changed=false;
    if(lib.isDirectory()){
      for(int n=0;n<names.length;n++){
        Resource[] children = lib.listResources(new MyResourceNameFilter(names[n].trim()));
        for(int i=0;i<children.length;i++){
          try {
            changed=true;
            IOUtil.closeEL(config.getClassLoader());
            children[i].remove(false);
View Full Code Here

          }
        return ;
      }
   
      // ConfigWeb
      Resource trg = config.getConfigDir().getRealResource("context").getRealResource(realpath);
        if(trg.exists()) trg.remove(true);
        Resource p = trg.getParentResource();
        if(!p.isDirectory()) p.createDirectory(true);
        IOUtil.copy(is, trg.getOutputStream(false), closeStream,true);
        filesDeployed.add(trg);
        _store((ConfigImpl)config);
    }
View Full Code Here

     
    if(config instanceof ConfigServer) {
      ConfigServer cs = ((ConfigServer)config);
       
      // remove files from deploy folder
      Resource deploy = cs.getConfigDir().getRealResource("web-context-deployment");
        Resource trg = deploy.getRealResource(realpath);
       
        if(trg.exists()) {
          trg.remove(true);
          ResourceUtil.removeEmptyFolders(deploy);
        }
       
      // remove files from railo web context
      boolean store=false;
      ConfigWeb[] webs = cs.getConfigWebs();
        for(int i=0;i<webs.length;i++){
          if(_removeContext(webs[i], realpath,_store)) {
            store=true;
          }
        }
        return store;
      }
   
      // ConfigWeb
    Resource context = config.getConfigDir().getRealResource("context");
      Resource trg = context.getRealResource(realpath);
      if(trg.exists()) {
          trg.remove(true);
          if(_store) ConfigWebAdmin._store((ConfigImpl) config);
          ResourceUtil.removeEmptyFolders(context);
          return true;
        }
        return false;
View Full Code Here

      }
   
      // ConfigWeb
     
     
      Resource trg = config.getRootDirectory().getRealResource(realpath);
      if(trg.exists()) trg.remove(true);
        Resource p = trg.getParentResource();
        if(!p.isDirectory()) p.createDirectory(true);
        IOUtil.copy(is, trg.getOutputStream(false), closeStream,true);
        filesDeployed.add(trg);
        //_store((ConfigImpl)config);
    }
View Full Code Here

         
        return ;
      }
   
      // ConfigWeb
      Resource trg = config.getRootDirectory().getRealResource(realpath);
      if(trg.exists()) trg.remove(true);
    }
View Full Code Here

    if(destination==null)
      destination=ResourceUtil.toResourceNotExisting(pageContext, "thumbnails");
   
    // imagePrefix
    if(imagePrefix==null){
      Resource res = doc.getResource();
      if(res!=null){
        String n = res.getName();
        int index=n.lastIndexOf('.');
        if(index!=-1)imagePrefix=n.substring(0,index);
        else imagePrefix=n;
      }
      else imagePrefix="memory";
View Full Code Here

TOP

Related Classes of railo.commons.io.res.Resource

Copyright © 2018 www.massapicom. 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.