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

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

?? propertymanager.java

?? 這是學(xué)習(xí)Java必須讀懂兩套源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
        if (manager == null) {
            synchronized(managerLock) {
                if (manager == null) {
                    manager = new PropertyManager(propsName);
                }
            }
        }
        return manager.propFileIsWritable();
    }

    /**
     * Returns true if the yazd.properties file exists where the path property
     * purports that it does.
     */
    public static boolean propertyFileExists() {
        if (manager == null) {
            synchronized(managerLock) {
                if (manager == null) {
                    manager = new PropertyManager(propsName);
                }
            }
        }
        return manager.propFileExists();
    }

    /**
     * Returns the version number of Yazd as a String. i.e. -- major.minor.revision
     */
    public static String getYazdVersion() {
        return MAJOR_VERSION + "." + MINOR_VERSION + "." + REVISION_VERSION;
    }

    /**
     * Returns the major version number of Yazd. i.e. -- 1.x.x
     */
    public static int getYazdVersionMajor() {
        return MAJOR_VERSION;
    }

    /**
     * Returns the minor version number of Yazd. i.e. -- x.1.x
     */
    public static int getYazdVersionMinor() {
        return MINOR_VERSION;
    }

    /**
     * Returns the revision version number of Yazd. i.e. -- x.x.1
     */
    public static int getYazdVersionRevision() {
        return REVISION_VERSION;
    }

    private Properties properties = null;
    private Object propertiesLock = new Object();
    private String resourceURI;

    /**
     * Creates a new PropertyManager. Singleton access only.
     */
    private PropertyManager(String resourceURI) {
        this.resourceURI = resourceURI;
    }

    /**
     * Gets a Yazd property. Yazd properties are stored in yazd.properties.
     * The properties file should be accesible from the classpath. Additionally,
     * it should have a path field that gives the full path to where the
     * file is located. Getting properties is a fast operation.
     *
     * @param name the name of the property to get.
     * @return the property specified by name.
     */
    protected String getProp(String name) {
        //If properties aren't loaded yet. We also need to make this thread
        //safe, so synchronize...
        if (properties == null) {
            synchronized(propertiesLock) {
                //Need an additional check
                if (properties == null) {
                    loadProps();
                }
            }
        }
        String property = properties.getProperty(name);
        if (property == null) {
            return null;
        }
        else {
            return property.trim();
        }
    }

    /**
     * Sets a Yazd property. Because the properties must be saved to disk
     * every time a property is set, property setting is relatively slow.
     */
    protected void setProp(String name, String value) {
        //Only one thread should be writing to the file system at once.
        synchronized (propertiesLock) {
            //Create the properties object if necessary.
            if (properties == null) {
                loadProps();
            }
            properties.setProperty(name, value);
            saveProps();
        }
    }

    protected void deleteProp(String name) {
        //Only one thread should be writing to the file system at once.
        synchronized (propertiesLock) {
            //Create the properties object if necessary.
            if (properties == null) {
                loadProps();
            }
            properties.remove(name);
            saveProps();
        }
    }

    protected Enumeration propNames() {
        //If properties aren't loaded yet. We also need to make this thread
        //safe, so synchronize...
        if (properties == null) {
            synchronized(propertiesLock) {
                //Need an additional check
                if (properties == null) {
                    loadProps();
                }
            }
        }
        return properties.propertyNames();
    }

    /**
     * Loads Yazd properties from the disk.
     */
    private void loadProps() {
        properties = new Properties();
        InputStream in = null;
        try {
            in = getClass().getResourceAsStream(resourceURI);
            properties.load(in);
        }
        catch (Exception e) {
            System.err.println("Error reading Yazd properties in PropertyManager.loadProps() " + e);
            e.printStackTrace();
        }
        finally {
            try {
                in.close();
            } catch (Exception e) { }
        }
    }

    /**
     * Saves Yazd properties to disk.
     */
    private void saveProps() {
        //Now, save the properties to disk. In order for this to work, the user
        //needs to have set the path field in the properties file. Trim
        //the String to make sure there are no extra spaces.
        String path = properties.getProperty("path").trim();
        OutputStream out = null;
        try {
            out = new FileOutputStream(path);
            properties.store(out, "yazd.properties -- " + (new java.util.Date()));
        }
        catch (Exception ioe) {
            System.err.println("There was an error writing yazd.properties to " + path + ". " +
                "Ensure that the path exists and that the Yazd process has permission " +
                "to write to it -- " + ioe);
            ioe.printStackTrace();
        }
        finally {
            try {
               out.close();
            } catch (Exception e) { }
        }
    }

    /**
     * Returns true if the properties are readable. This method is mainly
     * valuable at setup time to ensure that the properties file is setup
     * correctly.
     */
    public boolean propFileIsReadable() {
        try {
            InputStream in = getClass().getResourceAsStream(resourceURI);
            return true;
        }
        catch (Exception e) {
            return false;
        }
    }

    /**
     * Returns true if the yazd.properties file exists where the path property
     * purports that it does.
     */
    public boolean propFileExists() {
        String path = getProp("path");
        if( path == null ) {
            return false;
        }
        File file = new File(path);
        if (file.isFile()) {
            return true;
        }
        else {
            return false;
        }
    }

    /**
     * Returns true if the properties are writable. This method is mainly
     * valuable at setup time to ensure that the properties file is setup
     * correctly.
     */
    public boolean propFileIsWritable() {
        String path = getProp("path");
        File file = new File(path);
        if (file.isFile()) {
            //See if we can write to the file
            if (file.canWrite()) {
                return true;
            }
            else {
                return false;
            }
        }
        else {
            return false;
        }
    }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精选一区二区三区| 久久综合九色综合97婷婷女人 | 激情综合网av| 午夜成人免费视频| 日韩一区精品字幕| 男人的天堂亚洲一区| 日本aⅴ精品一区二区三区| 日韩二区三区四区| 免费一区二区视频| 老司机免费视频一区二区| 久久99国产精品免费网站| 狠狠色综合播放一区二区| 国产91清纯白嫩初高中在线观看| 国产成a人亚洲| 99久久综合色| 欧美视频精品在线观看| 9191久久久久久久久久久| 日韩欧美综合在线| 国产婷婷色一区二区三区| 亚洲欧洲三级电影| 亚洲444eee在线观看| 美国十次了思思久久精品导航| 精品无人区卡一卡二卡三乱码免费卡 | 亚洲九九爱视频| 亚洲超碰精品一区二区| 麻豆91小视频| 福利电影一区二区三区| 一本色道久久加勒比精品 | 日韩欧美卡一卡二| 国产女主播一区| 亚洲影院免费观看| 精品一二线国产| 91麻豆国产自产在线观看| 7777精品久久久大香线蕉| 2021中文字幕一区亚洲| 国产精品动漫网站| 婷婷综合另类小说色区| 国产美女娇喘av呻吟久久| 91亚洲国产成人精品一区二三| 欧美日韩视频专区在线播放| wwww国产精品欧美| 亚洲乱码国产乱码精品精98午夜 | 精品国精品自拍自在线| 国产午夜精品福利| 亚洲一区中文在线| 国产精品中文欧美| 欧美丝袜第三区| 国产亚洲精品超碰| 亚洲成人自拍偷拍| 风间由美一区二区三区在线观看| 欧美亚日韩国产aⅴ精品中极品| 日韩视频一区二区三区在线播放| 国产精品毛片久久久久久| 轻轻草成人在线| 91女厕偷拍女厕偷拍高清| 精品国产一区二区三区不卡 | 99综合电影在线视频| 日韩你懂的电影在线观看| 国产精品成人一区二区艾草 | 久88久久88久久久| 在线观看网站黄不卡| 久久久久9999亚洲精品| 日韩综合在线视频| 99re免费视频精品全部| 337p粉嫩大胆噜噜噜噜噜91av| 亚洲精品成人在线| 国产精品一区一区三区| 91精品午夜视频| 亚洲美女电影在线| 国产91精品精华液一区二区三区 | 91美女片黄在线| 日韩欧美一区在线| 亚洲综合在线免费观看| 懂色一区二区三区免费观看| 日韩精品中文字幕在线一区| 亚洲一区二区免费视频| 91视频在线看| 欧美国产日本韩| 国产米奇在线777精品观看| 欧美二区三区的天堂| 亚洲国产人成综合网站| 99国产欧美久久久精品| 国产欧美一区二区精品性色超碰| 蜜桃免费网站一区二区三区| 欧美视频三区在线播放| 亚洲美女屁股眼交3| 99久久婷婷国产综合精品电影| 欧美精品一区二区在线播放| 日本欧美一区二区在线观看| 在线一区二区三区| 曰韩精品一区二区| 日本道在线观看一区二区| 亚洲欧洲色图综合| 91小宝寻花一区二区三区| 国产精品色一区二区三区| 国产成人无遮挡在线视频| 久久亚洲综合av| 国内精品免费在线观看| 精品国产91洋老外米糕| 国内精品久久久久影院薰衣草 | 日韩欧美一级精品久久| 日韩黄色片在线观看| 欧美日韩色一区| 亚洲成a人v欧美综合天堂下载| 欧美日韩在线免费视频| 亚洲福中文字幕伊人影院| 欧美色图激情小说| 婷婷久久综合九色国产成人| 欧美精品vⅰdeose4hd| 日本中文字幕一区二区视频 | 日韩理论片一区二区| 成人中文字幕电影| 亚洲图片欧美激情| 欧美中文字幕一区二区三区| 五月天一区二区三区| 欧美一区二区三区精品| 久久97超碰色| 国产拍欧美日韩视频二区| 成人国产视频在线观看| 亚洲精品国产一区二区三区四区在线 | 国产精品一区二区在线播放| 国产精品入口麻豆九色| 色天天综合色天天久久| 日韩一区精品视频| www欧美成人18+| av成人免费在线观看| 亚洲成人自拍网| 亚洲精品一区在线观看| 成人av网站免费观看| 亚洲最新视频在线观看| 日韩精品一区二区三区视频| 丁香一区二区三区| 亚洲一级二级在线| 精品国产一区a| 色婷婷av一区二区三区大白胸 | 色狠狠av一区二区三区| 日韩在线观看一区二区| 久久网这里都是精品| jizzjizzjizz欧美| 日韩精品欧美成人高清一区二区| 精品国产1区二区| 日本高清不卡一区| 精品制服美女丁香| 亚洲精品免费电影| 日韩欧美综合一区| 色综合视频一区二区三区高清| 亚洲成a人片综合在线| 国产亚洲一二三区| 欧美色视频在线| 高清不卡在线观看av| 五月综合激情网| 亚洲国产精品激情在线观看| 欧美高清dvd| 成人av电影在线观看| 欧美aⅴ一区二区三区视频| 国产精品久久久久久久久快鸭| 欧美高清激情brazzers| 99精品视频一区二区三区| 七七婷婷婷婷精品国产| 日韩毛片在线免费观看| 精品久久久久久久人人人人传媒| 91在线免费视频观看| 国模一区二区三区白浆| 午夜天堂影视香蕉久久| 中文字幕色av一区二区三区| 26uuu精品一区二区三区四区在线| 91福利视频网站| 风间由美一区二区三区在线观看| 日本aⅴ亚洲精品中文乱码| 亚洲激情图片小说视频| 欧美国产丝袜视频| 精品国产不卡一区二区三区| 欧美日韩免费不卡视频一区二区三区| 国产成+人+日韩+欧美+亚洲| 美国欧美日韩国产在线播放| 亚洲高清在线精品| 亚洲精品日日夜夜| 中文字幕一区在线| 久久久影视传媒| 欧美成人精品二区三区99精品| 欧洲日韩一区二区三区| 99re视频精品| a美女胸又www黄视频久久| 激情五月婷婷综合网| 日日夜夜精品视频天天综合网| 亚洲精品福利视频网站| 亚洲欧洲无码一区二区三区| 国产亚洲短视频| 久久综合久久久久88| 日韩免费观看高清完整版| 欧美日韩激情在线| 欧美在线一二三| 色婷婷综合久久久中文字幕| 91色porny蝌蚪| 97se亚洲国产综合自在线观| 国产成人8x视频一区二区| 高清国产一区二区三区| 成人综合婷婷国产精品久久蜜臀| 国产伦精品一区二区三区视频青涩| 另类调教123区|