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

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

?? uuri.java

?? 這是個爬蟲和lucece相結合最好了
?? JAVA
字號:
/* UURI * * $Id: UURI.java 4646 2006-09-22 17:23:04Z paul_jack $ * * Created on Apr 18, 2003 * * Copyright (C) 2003 Internet Archive. * * This file is part of the Heritrix web crawler (crawler.archive.org). * * Heritrix is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * any later version. * * Heritrix is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with Heritrix; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */package org.archive.net;import java.io.File;import java.io.Serializable;import java.net.URI;import java.net.URISyntaxException;import java.util.logging.Level;import java.util.logging.Logger;import org.apache.commons.httpclient.URIException;import org.archive.crawler.datamodel.CandidateURI;import org.archive.util.SURT;import org.archive.util.TextUtils;/** * Usable URI. *  * This class wraps {@link org.apache.commons.httpclient.URI} adding caching * and methods. It cannot be instantiated directly.  Go via UURIFactory. *  *  <p>We used to use {@link java.net.URI} for parsing URIs but ran across * quirky behaviors and bugs.  {@link java.net.URI} is not subclassable -- * its final -- and its unlikely that java.net.URI will change any time soon * (See Gordon's considered petition here: * <a href="http://developer.java.sun.com/developer/bugParade/bugs/4939847.html">java.net.URI * should have loose/tolerant/compatibility option (or allow reuse)</a>). * * <p>This class tries to cache calculated strings such as the extracted host * and this class as a string rather than have the parent class rerun its * calculation everytime. * * @author gojomo * @author stack * * @see org.apache.commons.httpclient.URI */public class UURI extends LaxURIimplements CharSequence, Serializable {    private static final long serialVersionUID = -1277570889914647093L;    private static Logger LOGGER =        Logger.getLogger(UURI.class.getName());        /**     * Consider URIs too long for IE as illegal.     */    public final static int MAX_URL_LENGTH = 2083;        public static final String MASSAGEHOST_PATTERN = "^www\\d*\\.";    /**     * Cache of the host name.     *     * Super class calculates on every call.  Profiling shows us spend 30% of     * total elapsed time in URI class.     */    private transient String cachedHost = null;    /**     * Cache of this uuri escaped as a string.     *     * Super class calculates on every call.  Profiling shows us spend 30% of     * total elapsed time in URI class.     */    private transient String cachedEscapedURI = null;    /**     * Cache of this uuri escaped as a string.     *     * Super class calculates on every call.  Profiling shows us spend 30% of     * total elapsed time in URI class.     */    private transient String cachedString = null;        /**     * Cached authority minus userinfo.     */    private transient String cachedAuthorityMinusUserinfo = null;    /**     * Cache of this uuri in SURT format     */    private transient String surtForm = null;        // Technically, underscores are disallowed in the domainlabel    // portion of hostname according to rfc2396 but we'll be more    // loose and allow them. See: [ 1072035 ] [uuri] Underscore in    // host messes up port parsing.    static {        hostname.set('_');    }    /**     * Shutdown access to default constructor.     */    protected UURI() {        super();    }        /**     * @param uri String representation of an absolute URI.     * @param escaped If escaped.     * @param charset Charset to use.     * @throws org.apache.commons.httpclient.URIException     */    protected UURI(String uri, boolean escaped, String charset)    throws URIException {        super(uri, escaped, charset);        normalize();    }        /**     * @param relative String representation of URI.     * @param base Parent UURI to use derelativizing.     * @throws org.apache.commons.httpclient.URIException     */    protected UURI(UURI base, UURI relative) throws URIException {        super(base, relative);        normalize();    }    /**     * @param uri String representation of a URI.     * @param escaped If escaped.     * @throws NullPointerException     * @throws URIException     */    public UURI(String uri, boolean escaped) throws URIException, NullPointerException {        super(uri,escaped);        normalize();    }    /**     * @param uri URI as string that is resolved relative to this UURI.     * @return UURI that uses this UURI as base.     * @throws URIException     */    public UURI resolve(String uri)    throws URIException {        return resolve(uri, false, // assume not escaped            this.getProtocolCharset());    }    /**     * @param uri URI as string that is resolved relative to this UURI.     * @param e True if escaped.     * @return UURI that uses this UURI as base.     * @throws URIException     */    public UURI resolve(String uri, boolean e)    throws URIException {        return resolve(uri, e, this.getProtocolCharset());    }        /**     * @param uri URI as string that is resolved relative to this UURI.     * @param e True if uri is escaped.     * @param charset Charset to use.     * @return UURI that uses this UURI as base.     * @throws URIException     */    public UURI resolve(String uri, boolean e, String charset)    throws URIException {        return new UURI(this, new UURI(uri, e, charset));    }    /**     * Test an object if this UURI is equal to another.     *     * @param obj an object to compare     * @return true if two URI objects are equal     */    public boolean equals(Object obj) {        // normalize and test each components        if (obj == this) {            return true;        }        if (!(obj instanceof UURI)) {            return false;        }        UURI another = (UURI) obj;        // scheme        if (!equals(this._scheme, another._scheme)) {            return false;        }        // is_opaque_part or is_hier_part?  and opaque        if (!equals(this._opaque, another._opaque)) {            return false;        }        // is_hier_part        // has_authority        if (!equals(this._authority, another._authority)) {            return false;        }        // path        if (!equals(this._path, another._path)) {            return false;        }        // has_query        if (!equals(this._query, another._query)) {            return false;        }        // UURIs do not have fragments        return true;    }    /**     * Strips www variants from the host.     *     * Strips www[0-9]*\. from the host.  If calling getHostBaseName becomes a     * performance issue we should consider adding the hostBasename member that     * is set on initialization.     *     * @return Host's basename.     * @throws URIException     */    public String getHostBasename() throws URIException {        // caching eliminated because this is rarely used        // (only benefits legacy DomainScope, which should        // be retired). Saves 4-byte object pointer in UURI        // instances.        return (this.getReferencedHost() == null)             ? null             : TextUtils.replaceFirst(MASSAGEHOST_PATTERN,                     this.getReferencedHost(), UURIFactory.EMPTY_STRING);    }    /**     * Override to cache result     *      * @return String representation of this URI     */    public synchronized String toString() {        if (this.cachedString == null) {            this.cachedString = super.toString();            coalesceUriStrings();        }        return this.cachedString;    }    public synchronized String getEscapedURI() {        if (this.cachedEscapedURI == null) {            this.cachedEscapedURI = super.getEscapedURI();            coalesceUriStrings();        }        return this.cachedEscapedURI;    }    /**     * The two String fields cachedString and cachedEscapedURI are      * usually identical; if so, coalesce into a single instance.      */    protected void coalesceUriStrings() {        if (this.cachedString != null && this.cachedEscapedURI != null                && this.cachedString.length() == this.cachedEscapedURI.length()) {            // lengths will only be identical if contents are identical            // (deescaping will always shrink length), so coalesce to            // use only single cached instance            this.cachedString = this.cachedEscapedURI;        }    }        public synchronized String getHost() throws URIException {        if (this.cachedHost == null) {            // If this._host is null, 3.0 httpclient throws            // illegalargumentexception.  Don't go there.            if (this._host != null) {            	this.cachedHost = super.getHost();                coalesceHostAuthorityStrings();            }        }        return this.cachedHost;    }        /**     * The two String fields cachedHost and cachedAuthorityMinusUserInfo are      * usually identical; if so, coalesce into a single instance.      */    protected void coalesceHostAuthorityStrings() {        if (this.cachedAuthorityMinusUserinfo != null                && this.cachedHost != null                && this.cachedHost.length() ==                    this.cachedAuthorityMinusUserinfo.length()) {            // lengths can only be identical if contents            // are identical; use only one instance            this.cachedAuthorityMinusUserinfo = this.cachedHost;        }    }    /**     * Return the referenced host in the UURI, if any, also extracting the      * host of a DNS-lookup URI where necessary.      *      * @return the target or topic host of the URI     * @throws URIException     */    public String getReferencedHost() throws URIException {        String referencedHost = this.getHost();        if(referencedHost==null && this.getScheme().equals("dns")) {            // extract target domain of DNS lookup            String possibleHost = this.getCurrentHierPath();            if(possibleHost != null && possibleHost.matches("[-_\\w\\.:]+")) {                referencedHost = possibleHost;            }        }        return referencedHost;    }    /**     * @return Return the 'SURT' format of this UURI     */    public String getSurtForm() {        if (surtForm == null) {            surtForm = SURT.fromURI(this.toString());        }        return surtForm;    }        /**     * Return the authority minus userinfo (if any).     *      * If no userinfo present, just returns the authority.     *      * @return The authority stripped of any userinfo if present.     * @throws URIException     */	public String getAuthorityMinusUserinfo()    throws URIException {        if (this.cachedAuthorityMinusUserinfo == null) {            String tmp = getAuthority();            if (tmp != null && tmp.length() > 0) {            	int index = tmp.indexOf('@');                if (index >= 0 && index < tmp.length()) {                    tmp = tmp.substring(index + 1);                }            }            this.cachedAuthorityMinusUserinfo = tmp;            coalesceHostAuthorityStrings();        }        return this.cachedAuthorityMinusUserinfo;	}    /* (non-Javadoc)     * @see java.lang.CharSequence#length()     */    public int length() {        return getEscapedURI().length();    }    /* (non-Javadoc)     * @see java.lang.CharSequence#charAt(int)     */    public char charAt(int index) {        return getEscapedURI().charAt(index);    }    /* (non-Javadoc)     * @see java.lang.CharSequence#subSequence(int, int)     */    public CharSequence subSequence(int start, int end) {        return getEscapedURI().subSequence(start,end);    }    /* (non-Javadoc)     * @see java.lang.Comparable#compareTo(java.lang.Object)     */    public int compareTo(Object arg0) {        return getEscapedURI().compareTo(arg0.toString());    }        /**     * Convenience method for finding the UURI inside an     * Object likely to have (or be/imply) one.     *      * @param o Object that is, has, or implies a UURI     * @return the UURI found, or null if none     */    public static UURI from(Object o) {        UURI u = null;        if (o instanceof UURI) {            u = (UURI)o;        } else if (o instanceof CandidateURI) {            u = ((CandidateURI) o).getUURI();        } else if (o instanceof CharSequence) {            String s = o.toString();            try {                u = UURIFactory.getInstance(s);            } catch (URIException e) {                LOGGER.log(Level.FINE,"bad URI",e);            }        }         return u;    }        /**     * Test if passed String has likely URI scheme prefix.     * @param possibleUrl URL string to examine.     * @return True if passed string looks like it could be an URL.     */    public static boolean hasScheme(String possibleUrl) {        boolean result = false;        for (int i = 0; i < possibleUrl.length(); i++) {            char c = possibleUrl.charAt(i);            if (c == ':') {                if (i != 0) {                    result = true;                }                break;            }            if (!scheme.get(c)) {                break;            }        }        return result;    }        /**     * @param pathOrUri A file path or a URI.     * @return Path parsed from passed <code>pathOrUri</code>.     * @throws URISyntaxException     */    public static String parseFilename(final String pathOrUri)    throws URISyntaxException {        String path = pathOrUri;        if (UURI.hasScheme(pathOrUri)) {            URI url = new URI(pathOrUri);            path = url.getPath();        }        return (new File(path)).getName();    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美人xxxx| 亚洲欧洲国产日韩| 亚洲人妖av一区二区| 日本美女一区二区三区视频| 成人av先锋影音| 欧美电视剧在线观看完整版| 亚洲一区影音先锋| 成人精品视频.| 久久久精品国产免大香伊| 五月天久久比比资源色| 99综合电影在线视频| 久久久美女毛片 | 欧美色图一区二区三区| 2021中文字幕一区亚洲| 免费成人美女在线观看.| 色婷婷综合久久久久中文| 国产欧美日产一区| 国产91富婆露脸刺激对白| 欧美不卡激情三级在线观看| 日韩国产高清在线| 91精品一区二区三区在线观看| 一区二区三区四区蜜桃| 色噜噜久久综合| 国产精品久久久久aaaa樱花| 高清国产一区二区三区| 国产蜜臀av在线一区二区三区| 精品伊人久久久久7777人| 欧美一级日韩免费不卡| 麻豆精品久久精品色综合| 欧美一区二区三区在线视频| 日韩精品亚洲专区| 日韩精品中午字幕| 黑人巨大精品欧美黑白配亚洲| 色综合久久中文综合久久97| 色婷婷国产精品久久包臀| 国产99久久久国产精品免费看| 91视视频在线观看入口直接观看www | 国产精品 欧美精品| 精品久久人人做人人爽| 久久精品国产免费| 久久久久久久综合狠狠综合| 久久aⅴ国产欧美74aaa| 欧美精品一区二区三区一线天视频 | 成人免费视频网站在线观看| 国产欧美精品一区二区色综合 | 国产福利一区二区三区视频在线 | 欧美一区二区日韩一区二区| 美女视频一区二区三区| 日韩欧美中文字幕精品| 国产在线日韩欧美| 国产精品国产三级国产普通话蜜臀| 99久久精品国产观看| 一区二区三区在线影院| 日韩色视频在线观看| 从欧美一区二区三区| 一区二区高清在线| 精品国产乱码久久久久久浪潮| 国产精品18久久久久久久久久久久 | 欧美成人性战久久| 不卡欧美aaaaa| 亚洲成人免费影院| 久久久精品中文字幕麻豆发布| 成a人片国产精品| 午夜免费久久看| 国产日韩欧美制服另类| 欧美性xxxxxxxx| 国产东北露脸精品视频| 亚洲电影中文字幕在线观看| 精品国产区一区| 一本到一区二区三区| 美女任你摸久久| 亚洲免费伊人电影| 久久久夜色精品亚洲| 欧美亚洲综合色| 国产精品一区免费视频| 午夜精品视频一区| 综合色中文字幕| 精品日本一线二线三线不卡| 在线观看三级视频欧美| 国产精品1区2区3区在线观看| 亚洲第一搞黄网站| 国产精品久久久久影视| 日韩欧美不卡一区| 日本道在线观看一区二区| 国产成人精品一区二| 日本在线不卡视频一二三区| 亚洲另类色综合网站| 国产精品视频看| 精品国产a毛片| 7777精品伊人久久久大香线蕉超级流畅| 成人一区二区三区中文字幕| 美国av一区二区| 麻豆一区二区在线| 日韩精品亚洲一区二区三区免费| 一区二区三区精品| 国产精品嫩草影院com| 久久久久一区二区三区四区| 日韩片之四级片| 日韩欧美卡一卡二| 91麻豆精品国产91久久久更新时间| 色视频欧美一区二区三区| 成人av小说网| 99热精品国产| 91首页免费视频| 色综合一个色综合| 99国产精品国产精品毛片| 国产成人在线网站| 国产乱码精品一区二区三区五月婷| 蜜桃久久久久久| 久久电影网站中文字幕| 免费成人在线播放| 激情综合五月天| 黄色日韩三级电影| 国产麻豆午夜三级精品| 国产成人综合自拍| 懂色av噜噜一区二区三区av| 国产精品香蕉一区二区三区| 成人网在线免费视频| av电影天堂一区二区在线| 暴力调教一区二区三区| 99riav一区二区三区| 91国偷自产一区二区开放时间 | proumb性欧美在线观看| 99精品国产视频| 欧美色大人视频| 3d动漫精品啪啪1区2区免费| 日韩精品专区在线| 日本一区二区高清| 一区二区日韩av| 免费在线观看一区| 国产一区二区福利视频| heyzo一本久久综合| 精品视频1区2区| 欧美电视剧在线观看完整版| 日本一区二区在线不卡| 亚洲精品视频在线观看网站| 亚洲h在线观看| 国产中文字幕精品| 色婷婷国产精品久久包臀| 欧美一级xxx| 欧美激情在线观看视频免费| 一区二区三区日本| 国产在线视视频有精品| 91浏览器入口在线观看| 欧美一区二区视频在线观看2020| 久久综合网色—综合色88| 亚洲老司机在线| 激情小说亚洲一区| 日本道在线观看一区二区| 日韩区在线观看| 一区二区三区在线视频观看58| 日韩av在线免费观看不卡| 成人手机在线视频| 欧美日韩五月天| 欧美高清在线精品一区| 日韩高清一区二区| 91小视频免费看| 亚洲精品一区二区三区精华液| 亚洲精品乱码久久久久久| 国产一区二区不卡在线| 欧美日韩一区二区三区四区五区 | 国产成人日日夜夜| 欧美日韩在线播放三区四区| 国产片一区二区三区| 婷婷综合久久一区二区三区| 不卡一区中文字幕| 久久中文娱乐网| 午夜久久久久久久久久一区二区| 菠萝蜜视频在线观看一区| 日韩精品一区二区三区中文精品| 亚洲码国产岛国毛片在线| 国产精品性做久久久久久| 日韩欧美中文一区二区| 一级日本不卡的影视| 99re在线视频这里只有精品| 久久久久青草大香线综合精品| 日本视频在线一区| 欧洲精品一区二区| 亚洲免费观看在线观看| 高清shemale亚洲人妖| 精品久久国产字幕高潮| 日本不卡的三区四区五区| 欧美视频在线观看一区| 亚洲欧美经典视频| 91色视频在线| 亚洲欧洲av另类| 高清beeg欧美| 中文字幕乱码一区二区免费| 国产乱码一区二区三区| 精品成人佐山爱一区二区| 免费在线视频一区| 日韩免费视频线观看| 蜜桃一区二区三区在线| 日韩精品专区在线影院观看| 日本免费新一区视频| 日韩午夜激情电影| 日本成人超碰在线观看| 日韩午夜小视频| 国产在线精品国自产拍免费| 久久亚洲二区三区|