Package railo.runtime.config

Examples of railo.runtime.config.Config


   * @param className
   * @return matching Class
   * @throws ClassException
   */
  public static Class loadClass(String className) throws ClassException {
    Config config = ThreadLocalPageContext.getConfig();
    Class clazz = loadClass(config==null?null:config.getClassLoader(),className,null);
    if(clazz!=null) return clazz;
    throw new ClassException("cannot load class through its string name, because no definition for the class with the specified name ["+className+"] could be found");
  }
View Full Code Here


          cl=pci.getClassLoader();
        }
        catch (IOException e) {}
      }
      if(cl==null) {
        Config config = ThreadLocalPageContext.getConfig();
        if(config!=null)cl=config.getClassLoader();
      }
    }
   
   
   
View Full Code Here

   

   
    public static String escapeQSValue(String str) {
      if(!ReqRspUtil.needEncoding(str,true)) return str;
      Config config = ThreadLocalPageContext.getConfig();
      if(config!=null){
        try {
          return URLEncoder.encode(str,config.getWebCharset());
        }
        catch (UnsupportedEncodingException e) {}
      }
      return URLEncoder.encode(str);
  }
View Full Code Here

     */
    public PhysicalClassLoader(Resource directory) throws IOException {
        this(directory,getParentCL());
    }
    private static ClassLoader getParentCL() {
    Config config = ThreadLocalPageContext.getConfig();
    if(config!=null) return config.getClassLoader();
      return new ClassLoaderHelper().getClass().getClassLoader();
  }
View Full Code Here

  }


  private static void addCustom(List<DateFormat> list,Locale locale,short formatType) {
    // get custom formats from file
    Config config = ThreadLocalPageContext.getConfig();
    Resource dir=config.getConfigDir().getRealResource("locales");
    if(dir.isDirectory()) {
      String appendix="-datetime";
      if(formatType==FORMAT_TYPE_DATE)appendix="-date";
      if(formatType==FORMAT_TYPE_TIME)appendix="-time";
     
View Full Code Here

  public static void printStack(PrintWriter pw) {
    new Throwable().printStackTrace(pw);
  }

  public static void printStack(int type) {
    Config config=ThreadLocalPageContext.getConfig();
      if(config!=null) {
        if(type==ERR)
          printStack(config.getErrWriter());
        else
          printStack(config.getOutWriter());
      }
      else {
        printStack(new PrintWriter((type==ERR)?System.err:System.out));
      }
  }
View Full Code Here

      printDate(getPrinWriter(type),value);
    }
   

    public static PrintWriter getPrinWriter(int type) {
      Config config=ThreadLocalPageContext.getConfig();
      if(config!=null) {
        if(type==ERR) return config.getErrWriter();
        return config.getOutWriter();
      }
      return SystemUtil.getPrintWriter(type);
    }
View Full Code Here

 
  public static Mapping[] createMappings(PageContext pc,Resource[] resources) {
     
      Mapping[] mappings=new Mapping[resources.length];
      Config config=pc.getConfig();
      for(int i=0;i<mappings.length;i++) {
        mappings[i]=CommonUtil.createMapping(config,
            "/",
            resources[i].getAbsolutePath()
            );
View Full Code Here

        String[] tmp = HTTPUtil.splitMimeTypeAndCharset(contentType,null);
        //String mimetype=tmp[0];
        String charset=tmp[1];
       
        if(StringUtil.isEmpty(charset,true)) {
          Config config = ThreadLocalPageContext.getConfig();
          if(config!=null)charset=config.getWebCharset();
        }
       
        try {
          return IOUtil.toString(is, charset);
        } catch (IOException e) {}
View Full Code Here

  }


  @Override
  public void output(String message) {
    Config config = ThreadLocalPageContext.getConfig();
    PrintWriter out=config==null?SystemUtil.getPrintWriter(SystemUtil.OUT):((ConfigWebImpl)config).getOutWriter();
    SystemOut.print(out, message);
  }
View Full Code Here

TOP

Related Classes of railo.runtime.config.Config

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.