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

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

?? filenameutils.java

?? < JavaME核心技術最佳實踐>>的全部源代碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
                        size -= (i - j);
                        i = j + 1;
                        continue outer;
                    }
                }
                // remove a/../ from a/../c
                System.arraycopy(array, i + 1, array, prefix, size - i);
                size -= (i + 1 - prefix);
                i = prefix + 1;
            }
        }
        
        if (size <= 0) {  // should never be less than 0
            return "";
        }
        if (size <= prefix) {  // should never be less than prefix
            return new String(array, 0, size);
        }
        if (lastIsDirectory && keepSeparator) {
            return new String(array, 0, size);  // keep trailing separator
        }
        return new String(array, 0, size - 1);  // lose trailing separator
    }

    //-----------------------------------------------------------------------
    /**
     * Concatenates a filename to a base path using normal command line style rules.
     * <p>
     * The effect is equivalent to resultant directory after changing
     * directory to the first argument, followed by changing directory to
     * the second argument.
     * <p>
     * The first argument is the base path, the second is the path to concatenate.
     * The returned path is always normalized via {@link #normalize(String)},
     * thus <code>..</code> is handled.
     * <p>
     * If <code>pathToAdd</code> is absolute (has an absolute prefix), then
     * it will be normalized and returned.
     * Otherwise, the paths will be joined, normalized and returned.
     * <p>
     * The output will be the same on both Unix and Windows except
     * for the separator character.
     * <pre>
     * /foo/ + bar          -->   /foo/bar
     * /foo + bar           -->   /foo/bar
     * /foo + /bar          -->   /bar
     * /foo + C:/bar        -->   C:/bar
     * /foo + C:bar         -->   C:bar (*)
     * /foo/a/ + ../bar     -->   foo/bar
     * /foo/ + ../../bar    -->   null
     * /foo/ + /bar         -->   /bar
     * /foo/.. + /bar       -->   /bar
     * /foo + bar/c.txt     -->   /foo/bar/c.txt
     * /foo/c.txt + bar     -->   /foo/c.txt/bar (!)
     * </pre>
     * (*) Note that the Windows relative drive prefix is unreliable when
     * used with this method.
     * (!) Note that the first parameter must be a path. If it ends with a name, then
     * the name will be built into the concatenated path. If this might be a problem,
     * use {@link #getFullPath(String)} on the base path argument.
     *
     * @param basePath  the base path to attach to, always treated as a path
     * @param fullFilenameToAdd  the filename (or path) to attach to the base
     * @return the concatenated path, or null if invalid
     */
    public static String concat(String basePath, String fullFilenameToAdd) {
        int prefix = getPrefixLength(fullFilenameToAdd);
        if (prefix < 0) {
            return null;
        }
        if (prefix > 0) {
            return normalize(fullFilenameToAdd);
        }
        if (basePath == null) {
            return null;
        }
        int len = basePath.length();
        if (len == 0) {
            return normalize(fullFilenameToAdd);
        }
        char ch = basePath.charAt(len - 1);
        if (isSeparator(ch)) {
            return normalize(basePath + fullFilenameToAdd);
        } else {
            return normalize(basePath + '/' + fullFilenameToAdd);
        }
    }

    //-----------------------------------------------------------------------
    /**
     * Converts all separators to the Unix separator of forward slash.
     * 
     * @param path  the path to be changed, null ignored
     * @return the updated path
     */
    public static String separatorsToUnix(String path) {
        if (path == null || path.indexOf(WINDOWS_SEPARATOR) == -1) {
            return path;
        }
        return path.replace(WINDOWS_SEPARATOR, UNIX_SEPARATOR);
    }

    /**
     * Converts all separators to the Windows separator of backslash.
     * 
     * @param path  the path to be changed, null ignored
     * @return the updated path
     */
    public static String separatorsToWindows(String path) {
        if (path == null || path.indexOf(UNIX_SEPARATOR) == -1) {
            return path;
        }
        return path.replace(UNIX_SEPARATOR, WINDOWS_SEPARATOR);
    }

    /**
     * Converts all separators to the system separator.
     * 
     * @param path  the path to be changed, null ignored
     * @return the updated path
     */
    public static String separatorsToSystem(String path) {
        if (path == null) {
            return null;
        }
        if (SYSTEM_SEPARATOR == WINDOWS_SEPARATOR) {
            return separatorsToWindows(path);
        } else {
            return separatorsToUnix(path);
        }
    }

    //-----------------------------------------------------------------------
    /**
     * Returns the length of the filename prefix, such as <code>C:/</code> or <code>~/</code>.
     * <p>
     * This method will handle a file in either Unix or Windows format.
     * <p>
     * The prefix length includes the first slash in the full filename
     * if applicable. Thus, it is possible that the length returned is greater
     * than the length of the input string.
     * <pre>
     * Windows:
     * a\b\c.txt           --> ""          --> relative
     * \a\b\c.txt          --> "\"         --> current drive absolute
     * C:a\b\c.txt         --> "C:"        --> drive relative
     * C:\a\b\c.txt        --> "C:\"       --> absolute
     * \\server\a\b\c.txt  --> "\\server\" --> UNC
     *
     * Unix:
     * a/b/c.txt           --> ""          --> relative
     * /a/b/c.txt          --> "/"         --> absolute
     * ~/a/b/c.txt         --> "~/"        --> current user
     * ~                   --> "~/"        --> current user (slash added)
     * ~user/a/b/c.txt     --> "~user/"    --> named user
     * ~user               --> "~user/"    --> named user (slash added)
     * </pre>
     * <p>
     * The output will be the same irrespective of the machine that the code is running on.
     * ie. both Unix and Windows prefixes are matched regardless.
     *
     * @param filename  the filename to find the prefix in, null returns -1
     * @return the length of the prefix, -1 if invalid or null
     */
    public static int getPrefixLength(String filename) {
        if (filename == null) {
            return -1;
        }
        int len = filename.length();
        if (len == 0) {
            return 0;
        }
        char ch0 = filename.charAt(0);
        if (ch0 == ':') {
            return -1;
        }
        if (len == 1) {
            if (ch0 == '~') {
                return 2;  // return a length greater than the input
            }
            return (isSeparator(ch0) ? 1 : 0);
        } else {
            if (ch0 == '~') {
                int posUnix = filename.indexOf(UNIX_SEPARATOR, 1);
                int posWin = filename.indexOf(WINDOWS_SEPARATOR, 1);
                if (posUnix == -1 && posWin == -1) {
                    return len + 1;  // return a length greater than the input
                }
                posUnix = (posUnix == -1 ? posWin : posUnix);
                posWin = (posWin == -1 ? posUnix : posWin);
                return Math.min(posUnix, posWin) + 1;
            }
            char ch1 = filename.charAt(1);
            if (ch1 == ':') {
                ch0 = Character.toUpperCase(ch0);
                if (ch0 >= 'A' && ch0 <= 'Z') {
                    if (len == 2 || isSeparator(filename.charAt(2)) == false) {
                        return 2;
                    }
                    return 3;
                }
                return -1;
                
            } else if (isSeparator(ch0) && isSeparator(ch1)) {
                int posUnix = filename.indexOf(UNIX_SEPARATOR, 2);
                int posWin = filename.indexOf(WINDOWS_SEPARATOR, 2);
                if ((posUnix == -1 && posWin == -1) || posUnix == 2 || posWin == 2) {
                    return -1;
                }
                posUnix = (posUnix == -1 ? posWin : posUnix);
                posWin = (posWin == -1 ? posUnix : posWin);
                return Math.min(posUnix, posWin) + 1;
            } else {
                return (isSeparator(ch0) ? 1 : 0);
            }
        }
    }

    /**
     * Returns the index of the last directory separator character.
     * <p>
     * This method will handle a file in either Unix or Windows format.
     * The position of the last forward or backslash is returned.
     * <p>
     * The output will be the same irrespective of the machine that the code is running on.
     * 
     * @param filename  the filename to find the last path separator in, null returns -1
     * @return the index of the last separator character, or -1 if there
     * is no such character
     */
    public static int indexOfLastSeparator(String filename) {
        if (filename == null) {
            return -1;
        }
        int lastUnixPos = filename.lastIndexOf(UNIX_SEPARATOR);
        int lastWindowsPos = filename.lastIndexOf(WINDOWS_SEPARATOR);
        return Math.max(lastUnixPos, lastWindowsPos);
    }

    /**
     * Returns the index of the last extension separator character, which is a dot.
     * <p>
     * This method also checks that there is no directory separator after the last dot.
     * To do this it uses {@link #indexOfLastSeparator(String)} which will
     * handle a file in either Unix or Windows format.
     * <p>
     * The output will be the same irrespective of the machine that the code is running on.
     * 
     * @param filename  the filename to find the last path separator in, null returns -1
     * @return the index of the last separator character, or -1 if there
     * is no such character
     */
    public static int indexOfExtension(String filename) {
        if (filename == null) {
            return -1;
        }
        int extensionPos = filename.lastIndexOf(EXTENSION_SEPARATOR);
        int lastSeparator = indexOfLastSeparator(filename);
        return (lastSeparator > extensionPos ? -1 : extensionPos);
    }

    //-----------------------------------------------------------------------
    /**
     * Gets the prefix from a full filename, such as <code>C:/</code>
     * or <code>~/</code>.
     * <p>
     * This method will handle a file in either Unix or Windows format.
     * The prefix includes the first slash in the full filename where applicable.
     * <pre>
     * Windows:
     * a\b\c.txt           --> ""          --> relative
     * \a\b\c.txt          --> "\"         --> current drive absolute
     * C:a\b\c.txt         --> "C:"        --> drive relative
     * C:\a\b\c.txt        --> "C:\"       --> absolute
     * \\server\a\b\c.txt  --> "\\server\" --> UNC
     *
     * Unix:
     * a/b/c.txt           --> ""          --> relative
     * /a/b/c.txt          --> "/"         --> absolute
     * ~/a/b/c.txt         --> "~/"        --> current user
     * ~                   --> "~/"        --> current user (slash added)
     * ~user/a/b/c.txt     --> "~user/"    --> named user
     * ~user               --> "~user/"    --> named user (slash added)
     * </pre>
     * <p>
     * The output will be the same irrespective of the machine that the code is running on.
     * ie. both Unix and Windows prefixes are matched regardless.
     *
     * @param filename  the filename to query, null returns null
     * @return the prefix of the file, null if invalid
     */
    public static String getPrefix(String filename) {
        if (filename == null) {
            return null;
        }
        int len = getPrefixLength(filename);
        if (len < 0) {
            return null;
        }
        if (len > filename.length()) {
            return filename + UNIX_SEPARATOR;  // we know this only happens for unix
        }
        return filename.substring(0, len);
    }

    /**
     * Gets the path from a full filename, which excludes the prefix.
     * <p>
     * This method will handle a file in either Unix or Windows format.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91 com成人网| 国产原创一区二区三区| 99re这里都是精品| 国产精品久久一卡二卡| 色综合久久中文综合久久牛| 亚洲日本电影在线| 91官网在线免费观看| 午夜不卡在线视频| 欧美大胆人体bbbb| 国产91清纯白嫩初高中在线观看| 欧美高清在线视频| 欧美吻胸吃奶大尺度电影 | 丁香桃色午夜亚洲一区二区三区| 国产欧美精品一区| 在线视频一区二区三| 婷婷六月综合亚洲| 久久久不卡影院| 色94色欧美sute亚洲线路二| 秋霞影院一区二区| 中文字幕乱码日本亚洲一区二区| 色综合色综合色综合色综合色综合| 亚洲国产精品视频| 久久久久国产一区二区三区四区| 成人av在线网站| 五月激情综合网| 久久精品综合网| 在线看不卡av| 国产一区二区三区免费看 | 欧美自拍偷拍午夜视频| 精品一区二区三区免费观看 | 久久日韩粉嫩一区二区三区| 色综合久久中文字幕| 久久91精品国产91久久小草 | 欧美精品国产精品| 成人免费三级在线| 日本色综合中文字幕| 亚洲色欲色欲www在线观看| 欧美一区二区三级| 99精品视频在线播放观看| 另类小说一区二区三区| 亚洲人xxxx| 国产日韩精品久久久| 在线电影欧美成精品| 成人福利视频在线看| 蜜桃传媒麻豆第一区在线观看| 国产精品家庭影院| 精品国产亚洲一区二区三区在线观看| 99re在线视频这里只有精品| 狠狠色丁香久久婷婷综| 亚洲大片免费看| 国产精品白丝在线| 日韩精品在线网站| 欧美精品久久天天躁| 在线这里只有精品| 成人免费视频caoporn| 国产一本一道久久香蕉| 日韩成人一级大片| 亚洲国产精品一区二区久久| 亚洲欧美激情在线| 国产精品毛片无遮挡高清| 日韩欧美色综合网站| 欧美色综合网站| 一本大道综合伊人精品热热| 成人天堂资源www在线| 精品一区二区三区的国产在线播放 | 国产精品福利在线播放| 精品国产a毛片| 日韩限制级电影在线观看| 欧美日韩激情在线| 色噜噜久久综合| 一本一道综合狠狠老| 成人激情黄色小说| 成人听书哪个软件好| 成人国产免费视频| av成人老司机| 91在线小视频| 色噜噜狠狠成人网p站| 日本韩国精品在线| 色悠久久久久综合欧美99| 91在线视频网址| 色噜噜夜夜夜综合网| 欧洲精品在线观看| 欧美三区在线观看| 中文字幕一区二区三| 亚洲欧洲成人av每日更新| 国产精品久久久久久久久搜平片| 国产精品日日摸夜夜摸av| 国产精品国产三级国产专播品爱网| 国产精品久久久久久久久果冻传媒 | 日韩欧美一级片| 26uuu另类欧美| 国产精品国产精品国产专区不蜜 | 亚洲精品菠萝久久久久久久| 一区二区在线免费观看| 偷窥国产亚洲免费视频| 日本欧美加勒比视频| www.亚洲人| 色婷婷久久综合| 欧美日韩精品电影| 久久老女人爱爱| 自拍偷自拍亚洲精品播放| 婷婷中文字幕综合| 国产在线播放一区| 色女孩综合影院| 91精品国产综合久久久久久久| 欧美精品一区二区三区一线天视频 | 五月天精品一区二区三区| 久久99久久精品| 99在线精品观看| 欧美福利视频导航| 国产午夜精品久久久久久久 | 欧美日韩精品欧美日韩精品一综合| 日韩欧美国产综合在线一区二区三区| 2023国产精华国产精品| 亚洲色图色小说| 日本网站在线观看一区二区三区| 成人午夜看片网址| 欧美区一区二区三区| 欧美国产视频在线| 天天综合色天天综合色h| 国产精品一区免费视频| 欧美日韩日日夜夜| 国产精品天天看| 日韩av一级电影| 色综合咪咪久久| 久久精品夜色噜噜亚洲a∨| 亚洲一区二区三区在线| 国产成人8x视频一区二区| 欧美日韩精品二区第二页| 中文字幕免费不卡| 男人的天堂久久精品| 色婷婷av一区二区三区之一色屋| 精品国产制服丝袜高跟| 亚洲综合成人网| 成人毛片视频在线观看| 日韩欧美一区二区免费| 亚洲国产精品一区二区www| 成人免费观看av| 日韩一区二区免费在线电影| 亚洲视频在线一区二区| 久久91精品久久久久久秒播| 欧美高清视频不卡网| 亚洲欧美日韩在线| 国产91在线看| www欧美成人18+| 日韩和欧美一区二区| 91黄色激情网站| 亚洲色图欧洲色图| 成人h精品动漫一区二区三区| 欧美一级一区二区| 天堂成人免费av电影一区| 91久久线看在观草草青青| 中文字幕成人av| 成人在线综合网站| 国产日产欧美一区二区视频| 另类小说欧美激情| 91麻豆精品国产自产在线 | 日韩一区二区三区免费观看 | 久久精品国产色蜜蜜麻豆| 777xxx欧美| 天堂资源在线中文精品| 欧美性大战久久久久久久蜜臀| 亚洲日本免费电影| 一本到一区二区三区| 亚洲黄色性网站| 91蜜桃在线免费视频| 亚洲欧美色一区| 在线观看成人小视频| 亚洲综合视频网| 欧美午夜宅男影院| 亚洲3atv精品一区二区三区| 欧美日韩高清一区二区| 视频一区二区三区入口| 欧美一区二区在线看| 免费在线看一区| 精品剧情v国产在线观看在线| 久久国产综合精品| 久久亚洲精品小早川怜子| 国产91精品久久久久久久网曝门| 国产色综合一区| 成人午夜精品一区二区三区| 亚洲天堂精品在线观看| 欧美午夜一区二区三区免费大片| 亚洲高清久久久| 欧美一级欧美三级在线观看| 精品一区免费av| 国产情人综合久久777777| 97se亚洲国产综合在线| 亚洲国产一区二区三区| 日韩女优av电影在线观看| 欧美aaaaa成人免费观看视频| 欧美精品一区二区三区四区| av不卡免费电影| 亚洲成人第一页| 精品日韩欧美在线| 不卡在线视频中文字幕| 亚洲成av人片在www色猫咪| 欧美一区二区免费视频| 国产高清久久久久| 亚洲精品成a人|