亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? basepropertiesconfiguration.java

?? java servlet著名論壇源代碼
?? JAVA
字號:
package net.myvietnam.mvncore.configuration;

/* ====================================================================
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution, if
 *    any, must include the following acknowledgement:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgement may appear in the software itself,
 *    if and wherever such third-party acknowledgements normally appear.
 *
 * 4. The names "The Jakarta Project", "Commons", and "Apache Software
 *    Foundation" must not be used to endorse or promote products derived
 *    from this software without prior written permission. For written
 *    permission, please contact apache@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache"
 *    nor may "Apache" appear in their names without prior written
 *    permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 */

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import java.io.Reader;
import java.io.UnsupportedEncodingException;

import java.util.Date;
import java.util.Iterator;

import org.apache.commons.lang.StringUtils;

/**
 * loads the configuration from a properties file. <p>
 *
 * <p>The properties file syntax is explained here:
 *
 * <ul>
 *  <li>
 *   Each property has the syntax <code>key = value</code>
 *  </li>
 *  <li>
 *   The <i>key</i> may use any character but the equal sign '='.
 *  </li>
 *  <li>
 *   <i>value</i> may be separated on different lines if a backslash
 *   is placed at the end of the line that continues below.
 *  </li>
 *  <li>
 *   If <i>value</i> is a list of strings, each token is separated
 *   by a comma ','.
 *  </li>
 *  <li>
 *   Commas in each token are escaped placing a backslash right before
 *   the comma.
 *  </li>
 *  <li>
 *   If a <i>key</i> is used more than once, the values are appended
 *   like if they were on the same line separated with commas.
 *  </li>
 *  <li>
 *   Blank lines and lines starting with character '#' are skipped.
 *  </li>
 *  <li>
 *   If a property is named "include" (or whatever is defined by
 *   setInclude() and getInclude() and the value of that property is
 *   the full path to a file on disk, that file will be included into
 *   the ConfigurationsRepository. You can also pull in files relative
 *   to the parent configuration file. So if you have something
 *   like the following:
 *
 *   include = additional.properties
 *
 *   Then "additional.properties" is expected to be in the same
 *   directory as the parent configuration file.
 *
 *   Duplicate name values will be replaced, so be careful.
 *
 *  </li>
 * </ul>
 *
 * <p>Here is an example of a valid extended properties file:
 *
 * <p><pre>
 *      # lines starting with # are comments
 *
 *      # This is the simplest property
 *      key = value
 *
 *      # A long property may be separated on multiple lines
 *      longvalue = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
 *                  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 *
 *      # This is a property with many tokens
 *      tokens_on_a_line = first token, second token
 *
 *      # This sequence generates exactly the same result
 *      tokens_on_multiple_lines = first token
 *      tokens_on_multiple_lines = second token
 *
 *      # commas may be escaped in tokens
 *      commas.excaped = Hi\, what'up?
 *
 *      # properties can reference other properties
 *      base.prop = /base
 *      first.prop = ${base.prop}/first
 *      second.prop = ${first.prop}/second
 * </pre>
 *
 * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
 * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
 * @author <a href="mailto:daveb@miceda-data">Dave Bryson</a>
 * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
 * @author <a href="mailto:leon@opticode.co.za">Leon Messerschmidt</a>
 * @author <a href="mailto:kjohnson@transparent.com">Kent Johnson</a>
 * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
 * @author <a href="mailto:ipriha@surfeu.fi">Ilkka Priha</a>
 * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
 * @author <a href="mailto:mpoeschl@marmot.at">Martin Poeschl</a>
 * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
 * @version $Id: BasePropertiesConfiguration.java,v 1.2 2003/12/10 04:30:45 minhnn Exp $
 */
public abstract class BasePropertiesConfiguration
    extends BasePathConfiguration
{
    /** Allow file inclusion or not */
    private boolean includesAllowed = false;

    /**
     * This is the name of the property that can point to other
     * properties file for including other properties files.
     */
    protected static String include = "include";

    /**
     * Implementations of this class must implement this method.
     *
     * @param resourceName The Resource to load
     * @return An Input Stream
     *
     * @throws IOException Error while loading the properties file
     */
    protected abstract InputStream getPropertyStream(String resourceName)
        throws IOException;

    /**
     * Load the properties from the given input stream.
     *
     * @param input An InputStream.
     * @throws IOException
     */
    public void load(InputStream input)
        throws IOException
    {
        load(input, null);
    }

    /**
     * Load the properties from the given input stream and using the specified
     * encoding.
     *
     * @param input An InputStream.
     * @param enc An encoding.
     * @exception IOException
     */
    public synchronized void load(InputStream input, String enc)
        throws IOException
    {
        PropertiesReader reader = null;
        if (enc != null)
        {
            try
            {
                reader =
                  new PropertiesReader(new InputStreamReader(input, enc));
            }
            catch (UnsupportedEncodingException e)
            {
                // Get one with the default encoding...
            }
        }

        if (reader == null)
        {
            reader = new PropertiesReader(new InputStreamReader(input));
        }

        while (true)
        {
            String line = reader.readProperty();

            if (line == null)
            {
                break; // EOF
            }

            int equalSign = line.indexOf('=');
            if (equalSign > 0)
            {
                String key = line.substring(0, equalSign).trim();
                String value = line.substring(equalSign + 1).trim();

                // Though some software (e.g. autoconf) may produce
                // empty values like foo=\n, emulate the behavior of
                // java.util.Properties by setting the value to the
                // empty string.

                if (StringUtils.isNotEmpty(getInclude())
                    && key.equalsIgnoreCase(getInclude()))
                {
                    if (getIncludesAllowed())
                    {
                        String [] files = StringUtils.split(value, ",");
                        for (int cnt = 0 ; cnt < files.length ; cnt++)
                        {
                            load(getPropertyStream(files[cnt].trim()));
                        }
                    }
                }
                else
                {
                    addProperty(key, value);
                }
            }
        }
    }

    /**
     * save properties to a file.
     * properties with multiple values are saved comma seperated.
     *
     * @param filename name of the properties file
     * @throws IOException
     */
    public void save(String filename)
        throws IOException
    {
        File file = new File(filename);
        PropertiesWriter out = new PropertiesWriter(file);

        out.writeComment("written by PropertiesConfiguration");
        out.writeComment(new Date().toString());

        for (Iterator i = this.getKeys(); i.hasNext();)
        {
            String key = (String) i.next();
            String value = StringUtils.join(this.getStringArray(key), ", ");
            out.writeProperty(key, value);
        }
        out.flush();
        out.close();
    }

    /**
     * Gets the property value for including other properties files.
     * By default it is "include".
     *
     * @return A String.
     */
    public String getInclude()
    {
        return BasePropertiesConfiguration.include;
    }

    /**
     * Sets the property value for including other properties files.
     * By default it is "include".
     *
     * @param inc A String.
     */
    public void setInclude(String inc)
    {
        BasePropertiesConfiguration.include = inc;
    }

    /**
     * Controls whether additional files can be loaded by the include = <xxx>
     * statement or not. Base rule is, that objects created by the empty
     * C'tor can not have included files.
     *
     * @param includesAllowed includesAllowed True if Includes are allowed.
     */
    protected void setIncludesAllowed(boolean includesAllowed)
    {
        this.includesAllowed = includesAllowed;
    }

    /**
     * Reports the status of file inclusion.
     *
     * @return True if include files are loaded.
     */
    public boolean getIncludesAllowed()
    {
        return this.includesAllowed;
    }

    /**
     * This class is used to read properties lines.  These lines do
     * not terminate with new-line chars but rather when there is no
     * backslash sign a the end of the line.  This is used to
     * concatenate multiple lines for readability.
     */
    class PropertiesReader
        extends LineNumberReader
    {
        /**
         * Constructor.
         *
         * @param reader A Reader.
         */
        public PropertiesReader(Reader reader)
        {
            super(reader);
        }

        /**
         * Read a property. Returns null if Stream is
         * at EOF. Concatenates lines ending with "\".
         * Skips lines beginning with "#" and empty lines.
         *
         * @return A string containing a property value or null
         *
         * @exception IOException
         */
        public String readProperty()
            throws IOException
        {
            StringBuffer buffer = new StringBuffer();

            while (true)
            {
                String line = readLine();
                if (line == null)
                {
                    // EOF
                    return null;
                }

                line = line.trim();

                if (StringUtils.isEmpty(line)
                    || (line.charAt(0) == '#'))
                {
                    continue;
                }

                if (line.endsWith("\\"))
                {
                    line = line.substring(0, line.length() - 1);
                    buffer.append(line);
                }
                else
                {
                    buffer.append(line);
                    break;
                }
            }
            return buffer.toString();
        }
    } // class PropertiesReader

    /**
     * This class is used to write properties lines.
     */
    class PropertiesWriter
        extends FileWriter
    {
        /**
         * Constructor.
         *
         * @param file the proerties file
         * @throws IOException
         */
        public PropertiesWriter(File file)
            throws IOException
        {
            super(file);
        }

        /**
         * Write a property.
         *
         * @param key
         * @param value
         * @exception IOException
         */
        public void writeProperty(String key, String value)
            throws IOException
        {
            write(key);
            write(" = ");
            write(value != null ? value : "");
            write('\n');
        }

        /**
         * Write a comment.
         *
         * @param comment
         * @exception IOException
         */
        public void writeComment(String comment)
            throws IOException
        {
            write("# " + comment + "\n");
        }
    } // class PropertiesWriter
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜视频在线观看一区二区 | 中文字幕高清不卡| 国产精品久久三区| 奇米色一区二区三区四区| 成人免费观看男女羞羞视频| 欧美伦理视频网站| 亚洲免费观看在线视频| 精品一区二区综合| 成a人片亚洲日本久久| 日韩精品一区二区三区swag| 夜夜嗨av一区二区三区网页 | 国产一区二区日韩精品| 欧美无人高清视频在线观看| 国产精品三级在线观看| 精彩视频一区二区三区| 欧美午夜精品免费| 亚洲三级在线免费观看| 国产精品自产自拍| 日韩午夜中文字幕| 五月婷婷久久综合| 欧美日韩综合一区| 亚洲制服丝袜av| 91丨九色porny丨蝌蚪| 中文字幕免费一区| 国产一区二区不卡老阿姨| 欧美高清激情brazzers| 亚洲电影欧美电影有声小说| 欧美中文字幕一区二区三区| 17c精品麻豆一区二区免费| 国产成人福利片| 久久综合中文字幕| 老司机精品视频导航| 日韩三级在线观看| 久久不见久久见免费视频1| 日韩欧美的一区二区| 精品一区二区在线视频| 精品欧美乱码久久久久久| 久久精品72免费观看| 亚洲精品一区二区三区福利| 国产精品一区一区| 国产欧美日韩亚州综合| 粉嫩av亚洲一区二区图片| 国产精品女主播av| 99久久精品国产一区二区三区 | 色国产综合视频| 亚洲国产中文字幕| 欧美人妇做爰xxxⅹ性高电影| 亚洲国产视频a| 在线播放国产精品二区一二区四区 | 国产suv精品一区二区三区| 国产精品私人自拍| 成人一区二区三区在线观看| 国产欧美日韩精品一区| 99视频超级精品| 亚洲在线一区二区三区| 欧美日本国产一区| 国产主播一区二区| 亚洲视频精选在线| 这里只有精品电影| 国产乱人伦偷精品视频免下载| 国产精品高潮呻吟| 欧美日韩的一区二区| 狠狠久久亚洲欧美| 亚洲日本在线天堂| 日韩天堂在线观看| heyzo一本久久综合| 午夜不卡av在线| 国产精品三级视频| 欧美精品乱码久久久久久按摩| 国产一区在线看| 亚洲国产成人va在线观看天堂| 欧美一二三四在线| 99视频精品在线| 精品伊人久久久久7777人| 欧美激情一二三区| 欧美日韩一区视频| 国产99久久久久| 日本在线不卡视频| 亚洲欧美一区二区久久| 欧美三级三级三级爽爽爽| 国产精品综合二区| 日韩精品欧美精品| 亚洲美女区一区| 国产午夜精品福利| 91精品国产一区二区三区蜜臀| 国产精品性做久久久久久| 亚洲午夜精品17c| 日韩理论片一区二区| 久久久噜噜噜久噜久久综合| 欧美日韩在线不卡| av成人免费在线| 国产精品一二三四五| 日韩av在线发布| 亚洲狠狠爱一区二区三区| 亚洲国产成人私人影院tom | 日本欧美久久久久免费播放网| **网站欧美大片在线观看| 精品精品国产高清一毛片一天堂| 欧美日韩在线播放一区| 色诱视频网站一区| 成人免费黄色在线| 国产精品正在播放| 精品一区二区三区视频 | 日韩视频免费观看高清完整版| 色婷婷精品久久二区二区蜜臂av| 成年人国产精品| av不卡免费在线观看| 国产成人综合亚洲91猫咪| 紧缚奴在线一区二区三区| 日韩激情av在线| 蜜臀av国产精品久久久久 | 成人免费视频一区| 国产精品一区二区黑丝| 国产一区免费电影| 国产揄拍国内精品对白| 国产一区二区三区精品欧美日韩一区二区三区 | 国产91高潮流白浆在线麻豆| 精品无人码麻豆乱码1区2区| 国产一区在线观看视频| 国产精品一区二区你懂的| 国产一区视频在线看| 国产伦精品一区二区三区免费迷| 麻豆精品国产传媒mv男同| 久久99久久久欧美国产| 国产呦萝稀缺另类资源| 国产福利91精品一区二区三区| 丁香一区二区三区| 99久久99久久久精品齐齐| 91蜜桃传媒精品久久久一区二区| 色8久久精品久久久久久蜜| 在线观看视频一区二区| 欧美精品vⅰdeose4hd| 欧美一区二区三区白人| 精品国精品国产尤物美女| 久久精品亚洲国产奇米99| 国产精品视频免费| 亚洲美女屁股眼交3| 天天综合网 天天综合色| 免费在线看一区| 国产成人免费在线观看不卡| 99久久伊人久久99| 欧美综合在线视频| 69久久夜色精品国产69蝌蚪网| 日韩一区二区三区电影在线观看| 日韩手机在线导航| 国产精品进线69影院| 午夜精品久久久久久久99樱桃| 国产综合色在线视频区| av亚洲精华国产精华精华| 欧美日韩国产片| 久久久不卡网国产精品一区| 一区二区三区在线影院| 美女视频网站黄色亚洲| 高清日韩电视剧大全免费| 欧美日韩精品欧美日韩精品一 | 欧美一级理论片| 国产精品传媒入口麻豆| 欧美成人猛片aaaaaaa| 国产成人精品免费网站| 欧美日韩中文国产| 久久亚洲综合色| 亚洲电影欧美电影有声小说| 福利电影一区二区| 在线不卡a资源高清| 最近中文字幕一区二区三区| 久久99热这里只有精品| 一本色道久久综合亚洲精品按摩| 久久青草欧美一区二区三区| 午夜视频在线观看一区二区| 99久久综合国产精品| 久久综合九色综合欧美98| 午夜精彩视频在线观看不卡| 99久久国产免费看| 精品成人在线观看| 午夜精品aaa| 欧美视频一区二区在线观看| 中文字幕亚洲视频| 国产一区二区在线影院| 91麻豆精品国产91久久久资源速度| 中文字幕亚洲一区二区av在线 | 亚洲天堂久久久久久久| 激情五月播播久久久精品| 欧美日韩国产欧美日美国产精品| 成人欧美一区二区三区1314| 国产美女久久久久| 日韩欧美美女一区二区三区| 午夜精品久久一牛影视| 国产精品天美传媒| 欧美妇女性影城| 欧美大白屁股肥臀xxxxxx| 2020日本不卡一区二区视频| 亚洲欧洲色图综合| 国产成人福利片| 欧美激情一区二区三区不卡 | 日韩av中文在线观看| 欧美午夜精品一区二区三区| 亚洲午夜久久久久久久久电影院| 97se亚洲国产综合自在线不卡| 国产精品视频麻豆| 成人国产在线观看|