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

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

?? classloaderresource.java

?? jsr170接口的java實現(xiàn)。是個apache的開源項目。
?? JAVA
字號:
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.  See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License.  You may obtain a copy of the License at * *      http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package org.apache.jackrabbit.classloader;import java.io.IOException;import java.io.InputStream;import java.net.URL;import java.security.cert.Certificate;import java.util.Date;import java.util.jar.Manifest;import javax.jcr.Property;import javax.jcr.RepositoryException;import org.apache.jackrabbit.net.URLFactory;import org.slf4j.Logger;import org.slf4j.LoggerFactory;/** * The <code>ClassLoaderResource</code> class represents a resource looked up * by the {@link ClassPathEntry}s of the {@link RepositoryClassLoader}. The * class provides transparent access to the resource irrespective of the fact * on whether the resource is contained in a repository property or in an * JAR or ZIP archive. * <p> * This class is extended to implement depending features such as storing * resources in repository properties or JAR or ZIP archives. * * @author Felix Meschberger */class ClassLoaderResource {    /** default log category */    private static final Logger log =        LoggerFactory.getLogger(ClassLoaderResource.class);    /**     * The class path entry which loaded this class loader resource     */    private final ClassPathEntry pathEntry;    /**     * The name of this resource.     */    private final String name;    /**     * The repository property providing the resource's contents. This may be     * <code>null</code> if the resource was loaded from a JAR/ZIP archive.     */    private final Property resProperty;    /**     * The class optionally loaded/defined through this resource.     *     * @see #getLoadedClass()     * @see #setLoadedClass(Class)     */    private Class loadedClass;    /**     * The time in milliseconds at which this resource has been loaded from     * the repository.     */    private final long loadTime;        /**     * Flag indicating that this resource has already been checked for expiry     * and whether it is actually expired.     *      * @see #isExpired()     */    private boolean expired;    /**     * Creates an instance of this class for the class path entry.     *     * @param pathEntry The {@link ClassPathEntry} of the code source of this     *      class loader resource.     * @param name The path name of this resource.     * @param resProperty The <code>Property</code>providing the content's of     *      this resource. This may be <code>null</code> if the resource     *      was loaded from an JAR or ZIP archive.     */    /* package */ ClassLoaderResource(ClassPathEntry pathEntry, String name,            Property resProperty) {        this.pathEntry = pathEntry;        this.name = name;        this.resProperty = resProperty;        this.loadTime = System.currentTimeMillis();    }    /**     * Returns the {@link ClassPathEntry} which loaded this resource.     */    protected ClassPathEntry getClassPathEntry() {        return pathEntry;    }    /**     * Returns the name of this resource. This is the name used to find the     * resource, for example the class name or the properties file path.     */    public String getName() {        return name;    }    /**     * Returns the <code>Property</code> with which this resource is created.     */    protected Property getProperty() {        return resProperty;    }    /**     * Returns the time in milliseconds at which this resource has been loaded     */    protected long getLoadTime() {        return loadTime;    }    /**     * Returns the URL to access this resource, for example a JCR or a JAR URL.     * If the URL cannot be created from the resource data, <code>null</code> is     * returned.     */    public URL getURL() {        try {            return URLFactory.createURL(getClassPathEntry().session, getPath());        } catch (Exception e) {            log.warn("getURL: Cannot getURL for " + getPath(), e);        }        return null;    }    /**     * Returns the URL to the code source of this entry. If there is no code     * source available, <code>null</code> is returned.     * <p>     * This base class implementation returns the result of calling     * {@link ClassPathEntry#toURL()} on the class path entry from which this     * resource was loaded.     */    public URL getCodeSourceURL() {        return getClassPathEntry().toURL();    }    /**     * Returns an <code>InputStream</code> to read from the resource.     * <p>     * This base class implementation returns the result of calling the     * <code>getStream()</code> method on the resource's property or     * <code>null</code> if the property is not set.     */    public InputStream getInputStream() throws RepositoryException {        return (getProperty() != null) ? getProperty().getStream() : null;    }    /**     * Returns the size of the resource or -1 if the size cannot be found out.     * <p>     * This base class implementation returns the result of calling the     * <code>getLength()</code> method on the resource's property or -1 if     * the property is not set.     *     * @throws RepositoryException If an error occurrs trying to find the length     *      of the property.     */    public int getContentLength() throws RepositoryException {        return (getProperty() != null) ? (int) getProperty().getLength() : -1;    }    /**     * Returns the path of the property containing the resource.     * <p>     * This base class implementation returns the absolute path of the     * resource's property. If the property is not set or if an error occurrs     * accesing the property's path, the concatentation of the class path     * entry's path and the resource's name is returned.     */    public String getPath() {        if (getProperty() != null) {            try {                return getProperty().getPath();            } catch (RepositoryException re) {                // fallback                log.warn("getPath: Cannot retrieve path of entry " + getName(),                    re);            }        }        // fallback if no resource property or an error accessing the path of        // the property        return getSafePath();    }        /**     * Returns the path of the property containing the resource by appending     * the {@link #getName() name} to the path of the class path entry to which     * this resource belongs. This path need not necessairily be the same as     * the {@link #getProperty() path of the property} but will always succeed     * as there is no repository access involved.     */    protected String getSafePath() {        return getClassPathEntry().getPath() + getName();    }    /**     * Returns the time of the the last modification of the resource or -1 if     * the last modification time cannot be evaluated.     * <p>     * This base class implementation returns the result of calling the     * {@link Util#getLastModificationTime(Property)} method on the resource's     * property if not <code>null</code>. In case of an error or if the     * property is <code>null</code>, -1 is returned.     */    public long getLastModificationTime() {        if (getProperty() != null) {            try {                return Util.getLastModificationTime(getProperty());            } catch (RepositoryException re) {                log.info("getLastModificationTime of resource property", re);            }        }        // cannot find the resource modification time, use epoch        return -1;    }    /**     * Returns the resource as an array of bytes     */    public byte[] getBytes() throws IOException, RepositoryException {        InputStream in = null;        byte[] buf = null;        log.debug("getBytes");        try {            in = getInputStream();            log.debug("getInputStream() returned {}", in);            int length = getContentLength();            log.debug("getContentLength() returned {}", new Integer(length));            if (length >= 0) {                buf = new byte[length];                for (int read; length > 0; length -= read) {                    read = in.read(buf, buf.length - length, length);                    if (read == -1) {                        throw new IOException("unexpected EOF");                    }                }            } else {                buf = new byte[1024];                int count = 0;                int read;                // read enlarging buffer                while ((read = in.read(buf, count, buf.length - count)) != -1) {                    count += read;                    if (count >= buf.length) {                        byte buf1[] = new byte[count * 2];                        System.arraycopy(buf, 0, buf1, 0, count);                        buf = buf1;                    }                }                // resize buffer if too big                if (count != buf.length) {                    byte buf1[] = new byte[count];                    System.arraycopy(buf, 0, buf1, 0, count);                    buf = buf1;                }            }        } finally {            if (in != null) {                try {                    in.close();                } catch (IOException ignore) {                }            }        }        return buf;    }    /**     * Returns the manifest from the jar file for this class resource. If this     * resource is not from a jar file, the method returns <code>null</code>,     * which is what the default implementation does.     */    public Manifest getManifest() {        return null;    }    /**     * Returns the certificates from the jar file for this class resource. If     * this resource is not from a jar file, the method returns     * <code>null</code>, which is what the default implementation does.     */    public Certificate[] getCertificates() {        return null;    }    /**     * Returns the <code>Property</code> which is used to check whether this     * resource is expired or not.     * <p>     * This base class method returns the same property as returned by the     * {@link #getProperty()} method. This method may be overwritten by     * implementations as appropriate.     *     * @see #isExpired()     */    protected Property getExpiryProperty() {        return getProperty();    }    /**     * Returns <code>true</code> if the last modification date of the expiry     * property of this resource is loaded is later than the time at which this     * resource has been loaded. If the last modification time of the expiry     * property cannot be calculated or if an error occurrs checking the expiry     * propertiy's last modification time, <code>true</code> is returned.     */    public boolean isExpired() {        if (!expired) {            // creation time of version if loaded now            long currentPropTime = 0;            Property prop = getExpiryProperty();            if (prop != null) {                try {                    currentPropTime = Util.getLastModificationTime(prop);                } catch (RepositoryException re) {                    // cannot get last modif time from property, use current time                    log.debug("expireResource: Cannot get current version for "                        + toString() + ", will expire", re);                    currentPropTime = System.currentTimeMillis();                }            }                // creation time of version currently loaded            long loadTime = getLoadTime();                // expire if a new version would be loaded            expired = currentPropTime > loadTime;            if (expired && log.isDebugEnabled()) {                log.debug(                    "expireResource: Resource created {} superceded by version created {}",                    new Date(loadTime), new Date(currentPropTime));            }        }                return expired;    }    /**     * Returns the class which was loaded through this resource. It is expected     * that the class loader sets the class which was loaded through this     * resource by calling the {@link #setLoadedClass(Class)} method. If this     * class was not used to load a class or if the class loader failed to     * set the class loaded through this resoource, this method will return     * <code>null</code>.     *     * @return The class loaded through this resource, which may be     *      <code>null</code> if this resource was never used to load a class     *      or if the loader failed to set class through the     *      {@link #setLoadedClass(Class)} method.     *     * @see #setLoadedClass(Class)     */    public Class getLoadedClass() {        return loadedClass;    }    /**     * Sets the class which was loaded through this resource. This method does     * not check, whether it is plausible that this class was actually loaded     * from this resource, nor does this method check whether the class object     * is <code>null</code> or not.     *     * @param loadedClass The class to be loaded.     */    public void setLoadedClass(Class loadedClass) {        this.loadedClass = loadedClass;    }    /**     * Returns the <code>String</code> representation of this resource.     */    public String toString() {        StringBuffer buf = new StringBuffer(getClass().getName());        buf.append(": path=");        buf.append(getSafePath());        buf.append(", name=");        buf.append(getName());        return buf.toString();    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品一区第一页| 亚洲成人一二三| 欧美欧美欧美欧美| 国模冰冰炮一区二区| 依依成人综合视频| 国产视频不卡一区| 欧美日本国产视频| 99re热这里只有精品视频| 免费看黄色91| 亚洲一级二级三级在线免费观看| 久久久久久久久久久电影| 欧美亚一区二区| 成人av网站在线观看| 精品一区二区三区视频| 亚洲超碰精品一区二区| 中文字幕欧美一区| 国产亚洲欧美日韩日本| 日韩欧美综合一区| 欧美巨大另类极品videosbest | 韩国毛片一区二区三区| 亚洲妇熟xx妇色黄| 亚洲摸摸操操av| 日本一区二区电影| 久久久午夜精品| 精品电影一区二区三区| 日韩免费高清视频| 日韩天堂在线观看| 欧美人伦禁忌dvd放荡欲情| 91福利视频在线| 色999日韩国产欧美一区二区| 成人国产精品视频| 成人午夜视频福利| 成人免费视频一区二区| 福利91精品一区二区三区| 国产精品亚洲第一区在线暖暖韩国| 男人操女人的视频在线观看欧美| 丝袜亚洲另类欧美综合| 天堂午夜影视日韩欧美一区二区| 亚洲大片在线观看| 丝袜亚洲精品中文字幕一区| 午夜精品福利视频网站| 日韩激情av在线| 日韩精品1区2区3区| 麻豆精品新av中文字幕| 老司机精品视频在线| 国产综合成人久久大片91| 国产激情视频一区二区在线观看| 国产美女娇喘av呻吟久久| 国产精品18久久久久久久网站| 国产成人精品综合在线观看| 成人h动漫精品一区二区| 本田岬高潮一区二区三区| 91在线精品一区二区| 欧美影视一区在线| 这里只有精品电影| 精品国产免费视频| 国产精品午夜在线| 亚洲男人的天堂一区二区 | www.亚洲在线| 一本久久a久久免费精品不卡| 色88888久久久久久影院按摩 | 在线一区二区视频| 欧美日本一区二区在线观看| 欧美刺激脚交jootjob| 日本一区二区三区在线不卡| 自拍视频在线观看一区二区| 亚洲自拍偷拍九九九| 91丝袜国产在线播放| 一本在线高清不卡dvd| 在线电影一区二区三区| www国产成人免费观看视频 深夜成人网| 国产亚洲婷婷免费| 亚洲欧美一区二区三区久本道91 | 国产成人av资源| 色菇凉天天综合网| 制服丝袜中文字幕一区| 久久精品欧美日韩| 亚洲综合色噜噜狠狠| 久久99深爱久久99精品| 97久久精品人人做人人爽| 3d动漫精品啪啪一区二区竹菊| 国产视频一区二区在线观看| 亚洲狠狠爱一区二区三区| 国产在线乱码一区二区三区| 一本一道综合狠狠老| 26uuu另类欧美| 一区二区成人在线| 国产在线精品免费| 欧美中文字幕一区| 久久久一区二区三区捆绑**| 亚洲综合成人网| 国产精品一区二区三区四区| 欧美日韩一区二区三区视频| 久久久国产精品麻豆 | 国产不卡在线一区| 777久久久精品| 亚洲日本中文字幕区| 国产在线精品不卡| 精品视频在线视频| 最好看的中文字幕久久| 激情另类小说区图片区视频区| 在线观看av一区二区| 中文字幕av资源一区| 蜜桃传媒麻豆第一区在线观看| 色婷婷亚洲婷婷| 欧美韩国日本综合| 国内精品久久久久影院一蜜桃| 欧美视频一区在线观看| 国产精品不卡一区| 精品一区二区三区在线播放视频 | 中文字幕在线观看不卡视频| 久久国产生活片100| 欧美精品日日鲁夜夜添| 亚洲精品ww久久久久久p站| 国产传媒日韩欧美成人| 欧美α欧美αv大片| 亚洲国产精品久久人人爱| 91网页版在线| 国产精品久久网站| 懂色av一区二区三区免费看| 精品国产91九色蝌蚪| 美腿丝袜亚洲综合| 欧美另类一区二区三区| 亚洲国产日韩a在线播放性色| 91在线观看免费视频| 国产精品萝li| 不卡电影一区二区三区| 中文欧美字幕免费| 国产成人av一区| 中文一区在线播放| 懂色一区二区三区免费观看| 久久久99精品免费观看不卡| 国产乱妇无码大片在线观看| 精品久久人人做人人爰| 蜜桃视频在线观看一区二区| 欧美一级黄色录像| 毛片一区二区三区| 精品久久久久一区二区国产| 精品一区二区在线播放| 亚洲精品一区二区三区四区高清| 久久99最新地址| 久久久精品2019中文字幕之3| 精品亚洲国内自在自线福利| 精品国产乱码久久久久久免费 | 欧美一区三区四区| 日日嗨av一区二区三区四区| 欧美一区二区在线免费播放| 美腿丝袜一区二区三区| 久久一二三国产| 不卡在线观看av| 亚洲精品伦理在线| 欧美人与性动xxxx| 蜜桃传媒麻豆第一区在线观看| 久久亚洲一区二区三区四区| 成人久久18免费网站麻豆| 亚洲精品日韩综合观看成人91| 欧美日韩色综合| 久久精品av麻豆的观看方式| 国产欧美日韩精品a在线观看| 99国产精品久久久久久久久久| 亚洲影院久久精品| 日韩一级片网址| 国产成a人亚洲| 一区二区三区精品视频在线| 日韩一区二区麻豆国产| 国产精品一区不卡| 一区二区三区欧美| 日韩视频免费观看高清完整版在线观看| 国内外精品视频| 亚洲欧洲99久久| 欧美男同性恋视频网站| 国产精品一区二区黑丝| 国内不卡的二区三区中文字幕| 国产精品三级久久久久三级| 欧美视频第二页| 国产在线播精品第三| 亚洲精品国产精华液| 欧美大片在线观看| 91免费小视频| 精品伊人久久久久7777人| 亚洲人成精品久久久久| 日韩欧美国产午夜精品| 色先锋aa成人| 国内成+人亚洲+欧美+综合在线| 一区二区三区四区不卡在线 | 欧美日韩一本到| 国产一区视频导航| 亚洲一级片在线观看| 欧美经典一区二区| 91麻豆精品国产自产在线| 成人国产在线观看| 蜜芽一区二区三区| 亚洲视频一区二区免费在线观看| 日韩午夜在线播放| 日本精品一区二区三区高清| 国产在线日韩欧美| 日本特黄久久久高潮| 亚洲免费观看高清完整版在线观看 | 国产欧美精品一区二区色综合朱莉| 欧美在线短视频|