Examples of XmlConfig


Examples of fr.eolya.utils.XMLConfig

 
  public static XMLConfig loadXmlConfig(String relativePath) {
    String home = ServletUtils.locateHome()
    String xmlConfigPath = home + relativePath;
    File xmlConfigFile = new File(xmlConfigPath);
    XMLConfig xmlConfig = null;
    if (xmlConfigFile!=null && xmlConfigFile.exists()) {
      xmlConfig = new XMLConfig();
      try {
        xmlConfig.loadFile(xmlConfigPath);
      } catch (IOException e) {
        e.printStackTrace();
        return null;
      }
      return xmlConfig;
View Full Code Here

Examples of fr.eolya.utils.XMLConfig

        propFileName = Utils.getValidPropertyPath(propFileName, null, "HOME");
        String settingsDirectoryPath = new File(propFileName).getParentFile().getAbsolutePath();
       
        System.out.println("Config file = " + propFileName);
       
        XMLConfig config = new XMLConfig();
        try {
            File configFile =new File(propFileName);
            if (!configFile.exists()) {
                System.out.println("Error configuration file not found [" + propFileName + "]");
                System.exit(-1);
            }
            config.loadFile(propFileName);
        }
        catch(IOException e) {
            System.out.println("Error while reading properties file");
            e.printStackTrace();
            System.exit(-1);     
        }
       
        String witnessFilesPath = config.getProperty("/indexer/param[@name='witnessfilespath']");
        witnessFilesPath = Utils.getValidPropertyPath(witnessFilesPath, null, "HOME");
        if (witnessFilesPath == null || "".equals(witnessFilesPath)) {
            System.out.println("Error : missing witness_files_path propertie");
            System.exit(-1);
        }
       
        String witnessFilesName = config.getProperty("/indexer/param[@name='witnessfilesname']", "indexer");
       
        File filePid = new File(witnessFilesPath + "/" + witnessFilesName + ".pid");
        if (filePid.exists()) {
            System.out.println("A indexer instance is already running");
            System.exit(-1);
View Full Code Here

Examples of fr.eolya.utils.XMLConfig

  public Source (int id, String className, String crawlMode, Map<String,Object> srcData) throws IOException {

    this.srcData = srcData;
    this.memLog = new StringBuffer();

    params = new XMLConfig();
    params.loadString((String)srcData.get("params"));

    extra = new XMLConfig();
    extra.loadString((String)srcData.get("extra"));

    this.id = id;
    this.className = className;
    this.crawlMode = crawlMode;    

    this.depth = getSrcDataInt("crawl_maxdepth", 0);

    processingElapsedTime = 0;
    processingLastTime = new Date().getTime();
    processingLastProcessedPageCount = 0;
    processingInfo = new XMLConfig();
    processingInfo.loadString((String)srcData.get("processing_info"));
    if (processingInfo!=null) {
      String elapsedTime = processingInfo.getProperty("/infos/elapsedtime");
      if (elapsedTime!=null && Utils.isStringNumeric(elapsedTime))
        processingElapsedTime = Long.parseLong(processingInfo.getProperty("/infos/elapsedtime"));
View Full Code Here

Examples of net.sourceforge.peers.XmlConfig

        if (logger == null) {
            logger = new Logger(this.peersHome);
        } else {
            this.logger = logger;
        }
        config = new XmlConfig(this.peersHome + File.separator
                + CONFIG_FILE, this.logger);
       
        cseqCounter = 1;
       
        StringBuffer buf = new StringBuffer();
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.