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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? basepropertiesconfiguration.java

?? 解觖java技術(shù)中后臺無法上傳數(shù)給的情況
?? 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
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久国产一区二区三区四区 | 成人精品免费视频| a级高清视频欧美日韩| 欧美日精品一区视频| 日韩欧美国产三级电影视频| 久久久国产精华| 亚洲区小说区图片区qvod| 中文字幕亚洲区| 亚洲激情欧美激情| 亚洲日本青草视频在线怡红院| 欧美激情在线一区二区| 国产精品每日更新在线播放网址| 亚洲视频一二三| 亚洲人精品一区| 精品国产成人系列| 亚洲aaa精品| 国产一区二区三区四区在线观看| 大白屁股一区二区视频| 在线观看免费成人| 亚洲色图在线播放| 亚洲欧美日韩综合aⅴ视频| 在线亚洲一区观看| 亚洲黄网站在线观看| 欧美四级电影网| 日韩欧美亚洲国产精品字幕久久久| 亚洲第一狼人社区| 欧美一区二区在线视频| 天天操天天干天天综合网| 日韩午夜精品视频| 精品一区二区精品| 精品一区二区三区在线播放| 95精品视频在线| 精品欧美黑人一区二区三区| 日本aⅴ亚洲精品中文乱码| 国产一区二区三区蝌蚪| 欧美亚男人的天堂| 国产拍揄自揄精品视频麻豆| 亚洲第一综合色| 视频在线观看一区二区三区| 国产资源在线一区| 丁香五精品蜜臀久久久久99网站 | 欧美一区二区三区爱爱| 加勒比av一区二区| 五月天丁香久久| 5858s免费视频成人| 日韩精品一区二区三区视频 | 欧美老女人在线| 精品福利在线导航| 亚洲精品视频在线| 久久综合九色欧美综合狠狠| 成人h动漫精品一区二区| 亚洲风情在线资源站| 亚洲美女视频在线| 亚洲欧洲日韩av| 亚洲精品国产第一综合99久久| 国产精品成人网| 精品一区二区在线观看| 欧美国产成人精品| 午夜成人免费视频| 亚洲精品在线免费播放| 在线视频亚洲一区| 色偷偷久久人人79超碰人人澡| 精品一区二区在线免费观看| 天堂一区二区在线| 欧美国产日韩亚洲一区| 国产日韩欧美在线一区| 日韩欧美一二三四区| 在线中文字幕一区| 在线一区二区三区| 成年人网站91| 国产成人精品影视| 99久久免费视频.com| 麻豆成人免费电影| 国产精品视频一二三区 | 69久久夜色精品国产69蝌蚪网| 亚洲va韩国va欧美va| 欧美一区二区精美| 国内精品国产三级国产a久久| 久久精品一区二区三区av| 亚洲另类春色校园小说| 欧美日韩日日摸| 国产综合成人久久大片91| 一区二区三区欧美亚洲| 日韩亚洲欧美一区二区三区| av在线不卡免费看| 日韩综合在线视频| 综合网在线视频| 久久国产综合精品| 日韩欧美中文字幕公布| 中文字幕一区二区三区蜜月| 亚洲欧美国产77777| 亚洲免费视频中文字幕| 欧美伊人久久久久久久久影院 | 91麻豆国产精品久久| 亚洲精品视频在线观看免费 | 亚洲成人久久影院| 日韩美女主播在线视频一区二区三区| 日韩电影免费一区| 日韩欧美国产小视频| 欧美色涩在线第一页| 久久99久久久久| 国产精品久久久久精k8| 欧美精品在线观看播放| 国产激情一区二区三区| 久久精品免费看| 午夜精品久久久久久久 | 国产成人综合自拍| 一区二区三区**美女毛片| 91精品国产综合久久久久久 | 国内外成人在线| 国产精品乱人伦| 欧美日韩电影一区| 成人午夜电影小说| 亚洲成a人在线观看| 美女在线观看视频一区二区| 日韩伦理电影网| 日韩三级免费观看| 成人免费精品视频| 一区二区三区日韩精品视频| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 精品三级在线看| 欧美美女bb生活片| 在线区一区二视频| 精品视频一区三区九区| 成人一级视频在线观看| 一区二区三区日韩| 欧美性色欧美a在线播放| 在线不卡中文字幕| 日本电影亚洲天堂一区| 日韩一区二区影院| 精品国产一区二区精华| 欧美精品久久天天躁| 国产成人在线观看免费网站| 久久精品72免费观看| 亚洲综合免费观看高清完整版 | 精品亚洲免费视频| 日本一区中文字幕 | 久久精品国产**网站演员| 精品黑人一区二区三区久久| 精品视频一区 二区 三区| 国内成人精品2018免费看| 国产乱淫av一区二区三区| 99re这里只有精品6| 色婷婷国产精品综合在线观看| 欧美久久久久久久久久| 2021国产精品久久精品| 捆绑紧缚一区二区三区视频 | 国产精品久久久久久妇女6080| 欧美午夜一区二区三区免费大片| 日韩三级在线观看| 午夜国产精品一区| 日韩精品国产精品| 亚洲国产精品视频| 日本一区二区综合亚洲| 欧美变态tickle挠乳网站| 欧美精品一区二区三区很污很色的| 日韩欧美一区二区久久婷婷| 制服.丝袜.亚洲.另类.中文| 精品入口麻豆88视频| 国产精品天干天干在观线| 亚洲精品免费电影| 丝袜美腿成人在线| 国产欧美日韩不卡免费| 日韩一区欧美二区| 欧美精品亚洲二区| 国产三级精品三级在线专区| 欧美成人一区二区| 亚洲欧美日韩国产中文在线| 2020国产精品久久精品美国| 欧美女孩性生活视频| 欧美大片在线观看一区二区| 波波电影院一区二区三区| 91精品啪在线观看国产60岁| 日韩视频免费观看高清完整版 | 国产欧美一区二区在线观看| 亚洲黄色小说网站| 欧美久久免费观看| 亚洲人成伊人成综合网小说| 国产精品麻豆一区二区| 欧美专区日韩专区| 国产乱子伦视频一区二区三区| 欧美丝袜丝nylons| 国产成人免费视频网站| 免费在线观看日韩欧美| 欧美日韩一区三区| 精品国产免费久久| 一本一道久久a久久精品| 天天色天天爱天天射综合| 国产盗摄视频一区二区三区| 亚洲一级电影视频| 国产精品91xxx| 亚洲六月丁香色婷婷综合久久 | 亚洲国产精品视频| 玉足女爽爽91| 国产精品美女一区二区| 一区二区三区丝袜| 国产99久久久精品| 91麻豆精品国产91久久久更新时间 | 欧美一级日韩免费不卡| 亚洲女同ⅹxx女同tv|