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

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

?? filenameutils.java

?? < JavaME核心技術最佳實踐>>的全部源代碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
    /**
     * Checks whether two filenames are equal after both have been normalized
     * and using the case rules of the system.
     * <p>
     * Both filenames are first passed to {@link #normalize(String)}.
     * The check is then performed case-sensitive on Unix and
     * case-insensitive on Windows.
     *
     * @param filename1  the first filename to query, may be null
     * @param filename2  the second filename to query, may be null
     * @return true if the filenames are equal, null equals null
     */
    public static boolean equalsNormalizedOnSystem(String filename1, String filename2) {
        return equals(filename1, filename2, true, true);
    }

    /**
     * Checks whether two filenames are equal after both have been normalized
     * and optionally using the case rules of the system.
     * <p>
     * Both filenames are first passed to {@link #normalize(String)}.
     *
     * @param filename1  the first filename to query, may be null
     * @param filename2  the second filename to query, may be null
     * @param system  whether to use the system (windows or unix)
     * @param normalized  whether to normalize the filenames
     * @return true if the filenames are equal, null equals null
     */
    private static boolean equals(
            String filename1, String filename2,
            boolean system, boolean normalized) {
        if (filename1 == filename2) {
            return true;
        }
        if (filename1 == null || filename2 == null) {
            return false;
        }
        if (normalized) {
            filename1 = normalize(filename1);
            filename2 = normalize(filename2);
        }
        if (system && (SYSTEM_SEPARATOR == WINDOWS_SEPARATOR)) {
            return filename1.equalsIgnoreCase(filename2);
        } else {
            return filename1.equals(filename2);
        }
    }

    //-----------------------------------------------------------------------
    /**
     * Checks whether the extension of the filename is that specified.
     * <p>
     * This method obtains the extension as the textual part of the filename
     * after the last dot. There must be no directory separator after the dot.
     * The extension check is case-sensitive on all platforms.
     *
     * @param filename  the filename to query, null returns false
     * @param extension  the extension to check for, null or empty checks for no extension
     * @return true if the filename has the specified extension
     */
    public static boolean isExtension(String filename, String extension) {
        if (filename == null) {
            return false;
        }
        if (extension == null || extension.length() == 0) {
            return (indexOfExtension(filename) == -1);
        }
        String fileExt = getExtension(filename);
        return fileExt.equals(extension);
    }

    /**
     * Checks whether the extension of the filename is one of those specified.
     * <p>
     * This method obtains the extension as the textual part of the filename
     * after the last dot. There must be no directory separator after the dot.
     * The extension check is case-sensitive on all platforms.
     *
     * @param filename  the filename to query, null returns false
     * @param extensions  the extensions to check for, null checks for no extension
     * @return true if the filename is one of the extensions
     */
    public static boolean isExtension(String filename, String[] extensions) {
        if (filename == null) {
            return false;
        }
        if (extensions == null || extensions.length == 0) {
            return (indexOfExtension(filename) == -1);
        }
        String fileExt = getExtension(filename);
        for (int i = 0; i < extensions.length; i++) {
            if (fileExt.equals(extensions[i])) {
                return true;
            }
        }
        return false;
    }

    /**
     * Checks whether the extension of the filename is one of those specified.
     * <p>
     * This method obtains the extension as the textual part of the filename
     * after the last dot. There must be no directory separator after the dot.
     * The extension check is case-sensitive on all platforms.
     *
     * @param filename  the filename to query, null returns false
     * @param extensions  the extensions to check for, null checks for no extension
     * @return true if the filename is one of the extensions
     */
    public static boolean isExtension(String filename, Collection extensions) {
        if (filename == null) {
            return false;
        }
        if (extensions == null || extensions.isEmpty()) {
            return (indexOfExtension(filename) == -1);
        }
        String fileExt = getExtension(filename);
        for (Iterator it = extensions.iterator(); it.hasNext();) {
            if (fileExt.equals(it.next())) {
                return true;
            }
        }
        return false;
    }

    //-----------------------------------------------------------------------
    /**
     * Checks a filename to see if it matches the specified wildcard matcher,
     * always testing case-sensitive.
     * <p>
     * The wildcard matcher uses the characters '?' and '*' to represent a
     * single or multiple wildcard characters.
     * This is the same as often found on Dos/Unix command lines.
     * The extension check is case-sensitive.
     * <pre>
     * wildcardMatch("c.txt", "*.txt")      --> true
     * wildcardMatch("c.txt", "*.jpg")      --> false
     * wildcardMatch("a/b/c.txt", "a/b/*")  --> true
     * wildcardMatch("c.txt", "*.???")      --> true
     * wildcardMatch("c.txt", "*.????")     --> false
     * </pre>
     * 
     * @param filename  the filename to match on
     * @param wildcardMatcher  the wildcard string to match against
     * @return true if the filename matches the wilcard string
     */
    public static boolean wildcardMatch(String filename, String wildcardMatcher) {
        return wildcardMatch(filename, wildcardMatcher, false);
    }

    /**
     * Checks a filename to see if it matches the specified wildcard matcher
     * using the case rules of the system.
     * <p>
     * The wildcard matcher uses the characters '?' and '*' to represent a
     * single or multiple wildcard characters.
     * This is the same as often found on Dos/Unix command lines.
     * The check is case-sensitive on Unix and case-insensitive on Windows.
     * <pre>
     * wildcardMatch("c.txt", "*.txt")      --> true
     * wildcardMatch("c.txt", "*.jpg")      --> false
     * wildcardMatch("a/b/c.txt", "a/b/*")  --> true
     * wildcardMatch("c.txt", "*.???")      --> true
     * wildcardMatch("c.txt", "*.????")     --> false
     * </pre>
     * 
     * @param filename  the filename to match on
     * @param wildcardMatcher  the wildcard string to match against
     * @return true if the filename matches the wilcard string
     */
    public static boolean wildcardMatchOnSystem(String filename, String wildcardMatcher) {
        return wildcardMatch(filename, wildcardMatcher, true);
    }

    /**
     * Checks a filename to see if it matches the specified wildcard matcher.
     * <p>
     * The wildcard matcher uses the characters '?' and '*' to represent a
     * single or multiple wildcard characters.
     * 
     * @param filename  the filename to match on
     * @param wildcardMatcher  the wildcard string to match against
     * @param system  whether to use the system (windows or unix)
     * @return true if the filename matches the wilcard string
     */
    private static boolean wildcardMatch(String filename, String wildcardMatcher, boolean system) {
        if (filename == null && wildcardMatcher == null) {
            return true;
        }
        if (filename == null || wildcardMatcher == null) {
            return false;
        }
        if (system && (SYSTEM_SEPARATOR == WINDOWS_SEPARATOR)) {
            filename = filename.toLowerCase();
            wildcardMatcher = wildcardMatcher.toLowerCase();
        }
        String[] wcs = splitOnTokens(wildcardMatcher);
        boolean anyChars = false;
        int textIdx = 0;
        int wcsIdx = 0;
        Stack backtrack = new Stack();
        
        // loop around a backtrack stack, to handle complex * matching
        do {
            if (backtrack.size() > 0) {
                int[] array = (int[]) backtrack.pop();
                wcsIdx = array[0];
                textIdx = array[1];
                anyChars = true;
            }
            
            // loop whilst tokens and text left to process
            while (wcsIdx < wcs.length) {
      
                if (wcs[wcsIdx].equals("?")) {
                    // ? so move to next text char
                    textIdx++;
                    anyChars = false;
                    
                } else if (wcs[wcsIdx].equals("*")) {
                    // set any chars status
                    anyChars = true;
                    if (wcsIdx == wcs.length - 1) {
                        textIdx = filename.length();
                    }
                    
                } else {
                    // matching text token
                    if (anyChars) {
                        // any chars then try to locate text token
                        textIdx = filename.indexOf(wcs[wcsIdx], textIdx);
                        if (textIdx == -1) {
                            // token not found
                            break;
                        }
                        int repeat = filename.indexOf(wcs[wcsIdx], textIdx + 1);
                        if (repeat >= 0) {
                            backtrack.push(new int[] {wcsIdx, repeat});
                        }
                    } else {
                        // matching from current position
                        if (!filename.startsWith(wcs[wcsIdx], textIdx)) {
                            // couldnt match token
                            break;
                        }
                    }
      
                    // matched text token, move text index to end of matched token
                    textIdx += wcs[wcsIdx].length();
                    anyChars = false;
                }
      
                wcsIdx++;
            }
            
            // full match
            if (wcsIdx == wcs.length && textIdx == filename.length()) {
                return true;
            }
            
        } while (backtrack.size() > 0);
  
        return false;
    }

    /**
     * Splits a string into a number of tokens.
     * 
     * @param text  the text to split
     * @return the tokens, never null
     */
    static String[] splitOnTokens(String text) {
        // used by wildcardMatch
        // package level so a unit test may run on this
        
        if (text.indexOf("?") == -1 && text.indexOf("*") == -1) {
            return new String[] { text };
        }

        char[] array = text.toCharArray();
        ArrayList list = new ArrayList();
        StringBuffer buffer = new StringBuffer();
        for (int i = 0; i < array.length; i++) {
            if (array[i] == '?' || array[i] == '*') {
                if (buffer.length() != 0) {
                    list.add(buffer.toString());
                    buffer.setLength(0);
                }
                if (array[i] == '?') {
                    list.add("?");
                } else if (list.size() == 0 ||
                        (i > 0 && list.get(list.size() - 1).equals("*") == false)) {
                    list.add("*");
                }
            } else {
                buffer.append(array[i]);
            }
        }
        if (buffer.length() != 0) {
            list.add(buffer.toString());
        }

        return (String[]) list.toArray(new String[0]);
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国偷自产国产一区| 精品亚洲国产成人av制服丝袜| 亚洲狠狠爱一区二区三区| 亚洲最色的网站| 另类小说综合欧美亚洲| 成人毛片在线观看| 91福利国产精品| www成人在线观看| 樱花影视一区二区| 久久99国产精品久久| 99久久精品情趣| 91精品国产全国免费观看 | 夜夜爽夜夜爽精品视频| 免费av网站大全久久| 成人久久18免费网站麻豆| 欧洲一区二区三区在线| 久久青草欧美一区二区三区| 亚洲国产一区二区三区| 国产精品 欧美精品| 91.成人天堂一区| 亚洲欧洲国产日本综合| 久久成人免费网| 色噜噜狠狠色综合中国| xvideos.蜜桃一区二区| 亚洲成精国产精品女| 成人蜜臀av电影| 日韩一区二区免费视频| 亚洲毛片av在线| 国产精品影音先锋| 制服丝袜中文字幕一区| 亚洲精品福利视频网站| 国产91精品露脸国语对白| 欧美一区国产二区| 亚洲九九爱视频| 国产乱人伦精品一区二区在线观看| 91麻豆免费看| 国产欧美久久久精品影院| 蜜臀av一区二区| 欧美日韩国产乱码电影| 亚洲免费av观看| 高清成人免费视频| 精品国产百合女同互慰| 五月激情六月综合| 91精彩视频在线| 中文字幕亚洲不卡| 成人天堂资源www在线| 日韩亚洲欧美高清| 亚洲一区二区视频在线| 不卡的看片网站| 久久精品无码一区二区三区| 青青草伊人久久| 欧美精品精品一区| 亚洲电影第三页| 欧美国产一区在线| 日本成人中文字幕在线视频| 欧美日韩小视频| 亚洲一区二区三区在线| 色婷婷国产精品| 亚洲日穴在线视频| 99视频热这里只有精品免费| 日本一区二区三区dvd视频在线| 久久99精品久久久| 日韩欧美的一区| 久久电影网站中文字幕| 日韩久久久精品| 激情综合亚洲精品| 久久综合丝袜日本网| 久久精品国产亚洲5555| 日韩精品一区在线| 国产主播一区二区三区| 久久午夜电影网| 韩国一区二区视频| 久久久久久久av麻豆果冻| 国产精品一区2区| 欧美国产精品v| 成人久久18免费网站麻豆| 国产精品美女久久久久aⅴ国产馆| 丁香五精品蜜臀久久久久99网站| 欧美激情一区二区三区在线| 不卡av免费在线观看| 综合欧美亚洲日本| 日本精品免费观看高清观看| 亚洲综合偷拍欧美一区色| 欧美视频你懂的| 天天色综合成人网| 日韩精品一区二区三区在线观看 | 成人免费看片app下载| 国产精品伦理一区二区| 99久久精品一区| 亚洲图片欧美色图| 日韩免费一区二区| 国产一区视频导航| 中文字幕一区二区视频| 在线一区二区三区四区| 五月综合激情网| 欧美成人伊人久久综合网| 国产精品白丝av| 亚洲乱码精品一二三四区日韩在线| 在线影院国内精品| 人人狠狠综合久久亚洲| 国产亚洲成年网址在线观看| 成人av在线资源网站| 一区二区视频在线| 制服丝袜亚洲播放| 国产成a人无v码亚洲福利| 亚洲精品第1页| 欧美大胆一级视频| 波多野结衣在线aⅴ中文字幕不卡| 中文字幕精品一区二区精品绿巨人 | 亚洲18色成人| 久久亚洲二区三区| 91网上在线视频| 日本成人在线网站| 亚洲国产精品激情在线观看| 欧美日韩在线亚洲一区蜜芽| 韩国精品免费视频| 一区二区三区日韩精品视频| 日韩一区二区在线观看视频播放| 成人夜色视频网站在线观看| 亚洲动漫第一页| 久久九九影视网| 欧美日韩一二三| 国产成人在线观看免费网站| 一区二区三区在线高清| 日韩免费视频一区二区| 日本黄色一区二区| 国产一区二区三区观看| 亚洲国产精品一区二区久久 | 成人中文字幕电影| 日韩国产成人精品| 自拍av一区二区三区| 欧美电视剧在线观看完整版| 色婷婷综合久久久中文字幕| 极品少妇xxxx精品少妇偷拍| 亚洲综合在线免费观看| 国产午夜精品美女毛片视频| 欧美久久久久久蜜桃| 成人精品鲁一区一区二区| 奇米精品一区二区三区在线观看一| 中文字幕一区二区三区乱码在线 | 国产精品一二三区| 天天色 色综合| 亚洲三级理论片| 国产亚洲精品bt天堂精选| 91麻豆精品国产91久久久使用方法 | 一二三四社区欧美黄| 久久精品欧美一区二区三区不卡 | 五月婷婷久久丁香| 中文字幕亚洲欧美在线不卡| 精品久久久久香蕉网| 欧美日韩在线免费视频| 91在线云播放| 高清久久久久久| 国产主播一区二区三区| 天天av天天翘天天综合网| 亚洲欧美一区二区三区孕妇| 国产女主播在线一区二区| 欧美videos中文字幕| 欧美精品99久久久**| 欧美综合亚洲图片综合区| 99久久精品99国产精品| 成人黄页在线观看| 国产一区二区三区免费播放| 麻豆精品视频在线观看免费| 偷拍与自拍一区| 亚洲成人综合视频| 亚洲国产成人av好男人在线观看| 亚洲欧美怡红院| 国产精品狼人久久影院观看方式| 国产欧美视频一区二区三区| 久久久久久毛片| 国产亚洲一区字幕| 久久无码av三级| 久久综合久久综合久久| 精品国产乱码久久久久久夜甘婷婷 | 国产日韩亚洲欧美综合| 久久久久久久久岛国免费| 亚洲精品在线观看视频| 亚洲精品一区二区三区蜜桃下载 | 国产美女精品一区二区三区| 麻豆国产一区二区| 久久精品国产一区二区三 | 久久精品欧美日韩| 久久久精品欧美丰满| 久久久精品国产99久久精品芒果| 久久久三级国产网站| 国产农村妇女精品| 国产精品久久久久久久久免费樱桃 | 7878成人国产在线观看| 欧美日本国产视频| 欧美男女性生活在线直播观看| 欧美日韩aaaaa| 欧美一区二区三区日韩| 欧美精品 国产精品| 欧美一区二区三区免费视频| 精品久久久久久久久久久久久久久久久 | 久久久久久麻豆| 国产精品系列在线| 自拍偷拍欧美激情| 亚洲国产成人91porn|