FileDocCategorySizeDatePackage
ConfigBean.javaAPI DocExample2091Mon Mar 01 16:32:06 GMT 2004com.develop.ss.config

ConfigBean.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;
    }

}