Package railo.commons.io.res

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


   
      // 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);
    }
  public boolean removeContext(Config config, boolean store,String... realpathes) throws PageException, IOException, SAXException {
View Full Code Here


     
     
      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

  private String touchDestination() throws IOException {
    if(destination==null) {
      String name=CreateUUID.call(pageContext)+"."+format;
      Resource folder = pageContext.getConfig().getTempDirectory().getRealResource("graph");
      if(!folder.exists())folder.createDirectory(true);
      destination = folder.getRealResource(name);
      cleanOld(folder);
     
      // create path
      String cp = pageContext.getHttpServletRequest().getContextPath();
View Full Code Here

   
    Resource parent = resource.getParentResource();
    // when there is a parent but the parent does not exist
    if(parent!=null) {
      if(!parent.exists()) {
        if(createParentWhenNotExists)parent.createDirectory(true);
        else throw new IOException("can't create file ["+resource.getPath()+"], missing parent directory");
      }
      else if(parent.isFile()) {
        throw new IOException("can't create directory ["+resource.getPath()+"], parent is a file");
      }
View Full Code Here

   
    Resource parent = resource.getParentResource();
    // when there is a parent but the parent does not exist
    if(parent!=null) {
      if(!parent.exists()) {
        if(createParentWhenNotExists)parent.createDirectory(true);
        else throw new IOException("can't create file ["+resource.getPath()+"], missing parent directory");
      }
      else if(parent.isFile()) {
        throw new IOException("can't create file ["+resource.getPath()+"], parent is a file");
      }
View Full Code Here

  public ClassLoader getRPCClassLoader(boolean reload) throws IOException {
   
    if(rpcClassLoader!=null && !reload) return rpcClassLoader;
       
    Resource dir = getDeployDirectory().getRealResource("RPC");
    if(!dir.exists())dir.createDirectory(true);
    //rpcClassLoader = new PhysicalClassLoader(dir,getFactory().getServlet().getClass().getClassLoader());
    rpcClassLoader = new PhysicalClassLoader(dir,getClassLoader());
    return rpcClassLoader;
  }
 
View Full Code Here

   
  }
 
  private static Resource getDirectory(PageContext pc) throws IOException{
    Resource dir= pc.getConfig().getCacheDir();
    if(!dir.exists())dir.createDirectory(true);
    return dir;
  }
 
 
 
View Full Code Here

  public static void init(Config config,String[] cacheNames,Struct[] arguments) throws IOException {
    System.setProperty("net.sf.ehcache.enableShutdownHook", "true");
    Thread.currentThread().setContextClassLoader(config.getClassLoader());

    Resource dir = config.getConfigDir().getRealResource("ehcache"),hashDir;
    if(!dir.isDirectory())dir.createDirectory(true);
    String[] hashArgs=createHash(arguments);
   
    // create all xml
    HashMap mapXML = new HashMap();
    HashMap newManagers = new HashMap();
View Full Code Here

    Thread.currentThread().setContextClassLoader(config.getClassLoader());
   
   
   
    Resource dir = config.getConfigDir().getRealResource("ehcache"),hashDir;
    if(!dir.isDirectory())dir.createDirectory(true);
    String[] hashArgs=createHash(arguments);
   
    // create all xml
    HashMap<String,String> mapXML = new HashMap<String,String>();
    HashMap<String,CacheManagerAndHashLite> newManagers = new HashMap<String,CacheManagerAndHashLite>();
View Full Code Here

            configDir=ResourceUtil.createResource(frp.getResource(strConfig), FileUtil.LEVEL_GRAND_PARENT_FILE,FileUtil.TYPE_DIR);
        }
        if(configDir==null) throw new PageServletException(new ApplicationException("path ["+strConfig+"] is invalid"));
        if(!configDir.exists()){
          try {
        configDir.createDirectory(true);
      }
          catch (IOException e) {}
        }
        return configDir;
    }
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.