Package railo.commons.io.res

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


     */
    public static boolean isFile(Resource file) {
        if(file.exists()) return file.isFile();
        Resource parent=file.getParentResource();
        //try {
            return parent.mkdirs() && file.createNewFile();
        /*} catch (IOException e) {
            return false;
        }*/ 
    }
   
View Full Code Here


  }


  private Resource getStoragDir(Config config) {
      Resource storageDir = config.getConfigDir().getRealResource("storage");
    if(!storageDir.exists())storageDir.mkdirs();
    return storageDir;
  }
 
  public void storageSet(Config config,String key, Object value) throws ConverterException, IOException, SecurityException {
      checkWriteAccess();
View Full Code Here

    boolean exists=persis.exists();
    if(exists) persis.delete();
  }
  private Resource getFile(SpoolerTask task) {
    Resource dir = persisDirectory.getRealResource(task.closed()?"closed":"open");
    dir.mkdirs();
    return dir.getRealResource(task.getId()+".tsk");
  }
 
  private String createId(SpoolerTask task) {
    Resource dir = persisDirectory.getRealResource(task.closed()?"closed":"open");
View Full Code Here

    return dir.getRealResource(task.getId()+".tsk");
  }
 
  private String createId(SpoolerTask task) {
    Resource dir = persisDirectory.getRealResource(task.closed()?"closed":"open");
    dir.mkdirs();
   
    String id=null;
    do{
      id=StringUtil.addZeros(++count, 8);
    }while(dir.getRealResource(id+".tsk").exists());
View Full Code Here

      Resource classFile=classRootDir.getRealResource(className+".class");
      Resource classFileDirectory=classFile.getParentResource();
          byte[] barr = null;
      Page page = null;
     
      if(!classFileDirectory.exists()) classFileDirectory.mkdirs();
     
          try {
            page = cfmlTransformer.transform(config,source,tld,fld);
            barr = page.execute(source,classFile);
        IOUtil.copy(new ByteArrayInputStream(barr), classFile,true);
View Full Code Here

      Resource dir = getDeployDirectory(config);
      int ma = Info.getMajorVersion();
      int mi = Info.getMinorVersion();
      if(!dir.exists()) {
        if(ma>4 || ma==4 && mi>1) {// FUTURE remove the if contition
          dir.mkdirs();
        }
        return;
      }
     
      Resource[] children = dir.listResources(ALL_EXT);
View Full Code Here

    try{
      ConfigWebAdmin.removeRHExtension(ci,id);
     
      Resource trgDir = config.getConfigDir().getRealResource("extensions").getRealResource(type).getRealResource(name);
      trgFile = trgDir.getRealResource(ext.getName());
      trgDir.mkdirs();
      ResourceUtil.moveTo(ext, trgFile,true);
    }
      catch(Throwable t){
        log.error("extension", ExceptionUtil.getStacktrace(t, true));
      moveToFailedFolder(ext);
View Full Code Here

         
      }
      else {
        if(charset==null) charset=pageContext.getConfig().getResourceCharset();
        Resource logDir=config.getConfigDir().getRealResource("logs");
          if(!logDir.exists())logDir.mkdirs();
          try {
            Resource f = logDir.getRealResource(file);
                logger=new LogResource(f,railo.commons.io.log.Log.LEVEL_INFO,charset);
            } catch (IOException e) {
                throw Caster.toPageException(e);
View Full Code Here

     * @param id
     * @return returns the Index Directory
     */
    private Resource _getIndexDirectory(String id, boolean createIfNotExists) {
      Resource indexDir=collectionDir.getRealResource(id);
        if(createIfNotExists && !indexDir.exists())indexDir.mkdirs();
        return indexDir;
    }

    /**
     * get writer to id
View Full Code Here

  }
   
  private Resource _createSpellDirectory(String id) {
      Resource indexDir=collectionDir.getRealResource(id+"_"+(_getMax(true)+1)+"_spell");
      //print.out("create:"+indexDir);
        indexDir.mkdirs();
        return indexDir;
    }
   
    private Resource _getSpellDirectory(String id) {
      Resource indexDir=collectionDir.getRealResource(id+"_"+_getMax(false)+"_spell");
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.