自定义定时任务配置文件路径

@param cronSettingPath 定时任务配置文件路径（相对绝对都可）
6999
public static void setCronSetting(String cronSettingPath) {
		try {
			crontabSetting = new Setting(cronSettingPath, Setting.DEFAULT_CHARSET, false);
		} catch (SettingRuntimeException | NoResourceException e) {
			// ignore setting file parse error and no config error
		}
	}
953129
public void setPath(String path) throws URIException {

        if (path == null || path.length() == 0) {
            _path = _opaque = (path == null) ? null : path.toCharArray();
            setURI();
            return;
        }
        // set the charset to do escape encoding
        String charset = getProtocolCharset();

        if (_is_net_path || _is_abs_path) {
            _path = encode(path, allowed_abs_path, charset);
        } else if (_is_rel_path) {
            StringBuffer buff = new StringBuffer(path.length());
            int at = path.indexOf('/');
            if (at == 0) { // never 0
                throw new URIException(URIException.PARSING,
                        "incorrect relative path");
            }
            if (at > 0) {
                buff.append(encode(path.substring(0, at), allowed_rel_path,
                            charset));
                buff.append(encode(path.substring(at), allowed_abs_path,
                            charset));
            } else {
                buff.append(encode(path, allowed_rel_path, charset));
            }
            _path = buff.toString().toCharArray();
        } else if (_is_opaque_part) {
            StringBuffer buf = new StringBuffer();
            buf.insert(0, encode(path.substring(0, 1), uric_no_slash, charset));
            buf.insert(1, encode(path.substring(1), uric, charset));
            _opaque = buf.toString().toCharArray();
        } else {
            throw new URIException(URIException.PARSING, "incorrect path");
        }
        setURI();
    }
360609
public static void initLogConfig(String logConfigpath)
	{
		try {
			LoggerContext context =(LoggerContext)LogManager.getContext(false);
			if(context!=null)
			{
				 context.setConfigLocation(new File(logConfigpath).toURI());
			     context.reconfigure();//重新初始化Log4j2的配置上下文
			}else
			{
				ConfigurationSource source = new ConfigurationSource(new FileInputStream(logConfigpath));
				Configurator.initialize(null, source);
			}
			Logger log=LoggerFactory.getLogger(Log4jUtil.class);
			log.info("日志配置初始化完成:"+logConfigpath);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}  
	}
906828
static void generateConfigFile(String configFilePath) throws ConfigurationException {
        String fileExtention = FilenameUtils.getExtension(configFilePath);
        ConfigProvider<Configuration> provider = getProviderByFileExtention(fileExtention);
        if (!AuditUtil.isFileExists(configFilePath)) {
            provider.generateConfig(Configuration.DEFAULT, configFilePath);
        }
    }
200682
public static void clearContextPath ()
  {
    if (s_sServletContextPath != null)
    {
      if (LOGGER.isInfoEnabled () && !isSilentMode ())
        LOGGER.info ("The servlet context path '" + s_sServletContextPath + "' was cleared!");
      s_sServletContextPath = null;
    }
    if (s_sCustomContextPath != null)
    {
      if (LOGGER.isInfoEnabled () && !isSilentMode ())
        LOGGER.info ("The custom servlet context path '" + s_sCustomContextPath + "' was cleared!");
      s_sCustomContextPath = null;
    }
  }
1218688
public void setPath(String strPath) throws PageException {
	if (strPath == null) return;
	this.path = ResourceUtil.toResourceNotExisting(pageContext, strPath.trim());
	// this.path=new File(path.toLowerCase().trim());

	pageContext.getConfig().getSecurityManager().checkFileLocation(this.path);

	if (!this.path.exists()) {
	    Resource parent = this.path.getParentResource();
	    if (parent != null && parent.exists()) this.path.mkdirs();
	    else {
		throw new ApplicationException("attribute path of the tag collection must be a existing directory");
	    }
	}
	else if (!this.path.isDirectory()) throw new ApplicationException("attribute path of the tag collection must be a existing directory");
    }
1255310
public static void reInitLogConfig(String logConfigpath)
	{
		try {
			 LoggerContext context =(LoggerContext)LogManager.getContext(false);
		     context.setConfigLocation(new File(logConfigpath).toURI());
		     context.reconfigure(); //重新初始化Log4j2的配置上下文
		     Logger log=LoggerFactory.getLogger(Log4jUtil.class);
			 log.info("日志配置重新初始化完成:"+logConfigpath);
		} catch (Exception e) {
			e.printStackTrace();
		}  
	}
1370621
private synchronized void checkPath(String logPath) throws ParameterException {
		Validate.notNull(path);
		File cPath = new File(logPath);
		if(!cPath.exists())
			cPath.mkdirs();
		if(!cPath.isDirectory())
			throw new ParameterException(ErrorCode.INCOMPATIBILITY, logPath + " is not a valid path!");
	}
280373
public void setPath(String path) {
        if (path != null) {
            manifest = ManifestIterator.getInstance().findByPath(path);
        }
    }
1151018
public void setJsonCredentialsFile(String jsonCredentialsPath) {
    if (!Utility.isNullOrEmpty(jsonCredentialsPath)) {
      setJsonCredentialsFile(new File(jsonCredentialsPath));
    } else {
      setJsonCredentialsFile((File) null);
    }
  }
242895
public void setPath(String path) {
        this.path = path;

        List<Token> tokens = Tokenizer.tokenize(path, true);
        int tokenCount = 0;
        for (Token t : tokens) {
            if (t.getType() != TokenType.TEXT) {
                tokenCount++;
            }
        }
        if (tokenCount > 0) {
            this.pathTokens = tokens.toArray(new Token[0]);
        } else {
            this.pathTokens = null;
        }
    }
1242230
@Override
	public void setLoadPath(final String loadPath) {
		if (loadPath == null) {
			LOG.warn("Use the default value because SQL template path is set to NULL.");
			LOG.warn("Default load path[{}]", DEFAULT_LOAD_PATH);
			this.loadPath = DEFAULT_LOAD_PATH;
		} else {
			this.loadPath = loadPath;
		}
	}
1289457
public static void initialize(String configFilePath) {
        if (manager != null) {
            return;
        }

        logger.info("initialize");

        final Config config;
        try {
            config = JavaConfig.generateFromYamlConfig(new File(configFilePath));
        } catch (YamlConvertException e) {
            throw new RuntimeException(e);
        }

        // load srcTree from already dumped srcTree YAML
        final File srcTreeFile = CommonPath.srcTreeFile(config.getRootBaseRunOutputIntermediateDataDir());
        SrcTree srcTree = new SrcTree();
        try {
            srcTree.fromYamlObject(YamlUtils.load(srcTreeFile));
        } catch (YamlConvertException e) {
            throw new RuntimeException(e);
        }
        try {
            srcTree.resolveKeyReference();
        } catch (IllegalDataStructureException e) {
            throw new RuntimeException(e);
        }

        manager = new HookMethodManager(srcTree, config);

        if (!config.isRunTestOnly()) {
            // set up shutdown hook which generates HTML report
            Runtime.getRuntime().addShutdownHook(new Thread() {
                @Override
                public void run() {
                    HtmlReport report = new HtmlReport();
                    try {
                        report.generate(config.getRootBaseReportInputIntermediateDataDirs(),
                                config.getRootBaseReportOutputDir());
                    } catch (IllegalDataStructureException | IllegalTestScriptException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
        }
    }
234835
public static Properties loadConfig(final String propertyFilePath)
            throws Exception {

        try {

            // 用TOMCAT模式 来载入试试
            return ConfigLoaderUtils.loadWithTomcatMode(propertyFilePath);

        } catch (Exception e1) {

            try {
                // 用普通模式进行载入
                return loadWithNormalMode(propertyFilePath);

            } catch (Exception e2) {

                throw new Exception("cannot load config file: "
                        + propertyFilePath);
            }
        }
    }
996738
public void setContextPath(String contextPath) {

		if (contextPath != null && !contextPath.endsWith("/")) {
			contextPath += "/";
		}
		this.contextPath = contextPath;
	}
851848
public void resetFromXml(String xmlResourcePath) throws JoranException {
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
    JoranConfigurator configurator = new JoranConfigurator();
    configurator.setContext(context);
    context.reset();
    configurator.doConfigure(LogbackHelper.class.getResource(xmlResourcePath));
  }
1098367
public void loadConfig(final String path)
	{
		try {

			ConfigurationReader reader = new ConfigurationReader(path);
			ConfigSettings settings = reader.read();

			clear();

			this.type = settings.type;
			this.parameterMap = settings.parameterMap;
			this.archives = settings.archives;

		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}