⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configbean.java

📁 simple spider 源码 better light faster java 书籍源码.
💻 JAVA
字号:
package com.develop.ss.config;

import java.util.Properties;

public class ConfigBean {

    Properties props = new Properties();
    int maxlinks;
    String[] allowedExtensions;
    String skippedLinksFile;
    IndexPathBean indexPathBean = new IndexPathBean();
    String avoidLinks;

    public ConfigBean()
    {
        try
        {
            props.load(getClass().getResourceAsStream("/com.develop.ss.properties"));
            maxlinks = Integer.parseInt(props.getProperty("maxlinks"));
            allowedExtensions= props.getProperty("allowed.extensions").split(",");
            skippedLinksFile = props.getProperty("skipped.links.file");
            avoidLinks = props.getProperty("AvoidLinks");
        }
        catch(Exception ex)
        {

        }
    }

    public String getStringProperty(String propName)
    {
          return props.getProperty(propName);
    }
    public String[] getStringArrProperty(String propName, String sep)
    {
        return props.getProperty(propName).split(sep);
    }
    public String getSkippedLinksFile()
    {
        return skippedLinksFile;
    }
    public int getMaxLinks()
    {
        return maxlinks;
    }
    public String[] getAllowedExtensions()
    {
        return allowedExtensions;
    }

    public String getCurIndexPath()
    {
        String indexPath = "";
        try
        {
            indexPath = indexPathBean.getIndexPath();
        }
        catch(Exception ex)
        {
        }
        return indexPath;
    }

    public String getNextIndexPath()
    {
        String indexPath = "";
        try
        {
            indexPath = indexPathBean.getFlippedIndexPath();
        }
        catch(Exception ex)
        {
        }
        return indexPath;
    }

    public void flipIndexPath()
    {
        try
        {
            indexPathBean.flipIndexPath();
        }
        catch(Exception ex)
        {
        }
    }

    public String getAvoidLinks()
    {
        return avoidLinks;
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -