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

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

?? jcrjarurlconnection.java

?? jsr170接口的java實現。是個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.net;import java.io.IOException;import java.io.InputStream;import java.net.URL;import java.util.jar.JarEntry;import java.util.jar.JarInputStream;import javax.jcr.Property;import javax.jcr.RepositoryException;import org.slf4j.Logger;import org.slf4j.LoggerFactory;/** * The <code>JCRJarURLConnection</code> extends the * {@link org.apache.jackrabbit.net.JCRURLConnection} class to support accessing * archive files stored in a JCR Repository. * <p> * Just like the base class, this class requires the URL to resolve, either * directly or through primary item chain, to a repository <code>Property</code>. * <p> * Access to this connections property and archive entry content is perpared * with the {@link #connect()}, which after calling the base class implementation * to find the property tries to find the archive entry and set the connection's * fields according to the entry. This implementation's {@link #connect()} * method fails if the named entry does not exist in the archive. * <p> * The {@link #getInputStream()} method either returns an stream on the archive * entry or on the archive depending on whether an entry path is specified * in the URL or not. Like the base class implementation, this implementation * returns a new <code>InputStream</code> on each invocation. * <p> * If an entry path is defined on the URL, the header fields are set from the * archive entry: * <table border="0" cellspacing="0" cellpadding="3"> *  <tr><td><code>Content-Type</code><td>Guessed from the entry name or *      <code>application/octet-stream</code> if the type cannot be guessed *      from the name</tr> *  <tr><td><code>Content-Encoding</code><td><code>null</code></tr> *  <tr><td><code>Content-Length</code><td>The size of the entry</tr> *  <tr><td><code>Last-Modified</code><td>The last modification time of the *      entry</tr> * </table> * <p> * If no entry path is defined on the URL, the header fields are set from the * property by the base class implementation with the exception of the * content type, which is set to <code>application/java-archive</code> by * the {@link #connect()} method. * <p> * <em>Note that this implementation does only support archives stored in the * JCR Repository, no other contained storage such as </em>file<em> or * </em>http<em> is supported.</em> * <p> * This class is not intended to be subclassed or instantiated by clients. * * @author Felix Meschberger */public class JCRJarURLConnection extends JCRURLConnection {    /** default log category */    private static final Logger log =        LoggerFactory.getLogger(JCRJarURLConnection.class);    /**     * The name of the MIME content type for this connection's content if     * no entry path is defined on the URL (value is "application/java-archive").     */    protected static final String APPLICATION_JAR = "application/java-archive";    /**     * Creates an instance of this class for the given <code>url</code>     * supported by the <code>handler</code>.     *     * @param url The URL to base the connection on.     * @param handler The URL handler supporting the given URL.     */    JCRJarURLConnection(URL url, JCRJarURLHandler handler) {        super(url, handler);    }    /**     * Returns the path to the entry contained in the archive or     * <code>null</code> if the URL contains no entry specification in the     * path.     */    String getEntryPath() {        return getFileParts().getEntryPath();    }    /**     * Connects to the URL setting the header fields and preparing for the     * {@link #getProperty()} and {@link #getInputStream()} methods.     * <p>     * After calling the base class implemenation to get the basic connection,     * the entry is looked for in the archive to set the content type, content     * length and last modification time header fields according to the named     * entry. If no entry is defined on the URL, only the content type header     * field is set to <code>application/java-archive</code>.     * <p>     * When this method successfully returns, this connection is considered     * connected. In case of an exception thrown, the connection is not     * connected.     *     * @throws IOException if an error occurrs retrieving the data property or     *      any of the header field value properties or if any other errors     *      occurrs. Any cuasing exception is set as the cause of this     *      exception.     */    public synchronized void connect() throws IOException {        if (!connected) {            // have the base class connect to get the jar property            super.connect();            // we assume the connection is now (temporarily) connected,            // thus calling the getters will not result in a recursive loop            Property property = getProperty();            String contentType = getContentType();            String contentEncoding = getContentEncoding();            int contentLength = getContentLength();            long lastModified = getLastModified();            // mark as not connected to not get false positives if the            // following code fails            connected = false;            // Get hold of the data            try {                JarInputStream jins = null;                try {                    // try to get the jar input stream, fail if no jar                    jins = new JarInputStream(property.getStream());                    String entryPath = getEntryPath();                    if (entryPath != null) {                        JarEntry entry = findEntry(jins, entryPath);                        if (entry != null) {                            contentType = guessContentTypeFromName(entryPath);                            if (contentType == null) {                                contentType = APPLICATION_OCTET;                            }                            contentLength = (int) entry.getSize();                            lastModified = entry.getTime();                        } else {                            throw failure("connect", entryPath +                                " not contained in jar archive", null);                        }                    } else {                        // replaces the base class defined content type                        contentType = APPLICATION_JAR;                    }                } finally {                    if (jins != null) {                        try {                            jins.close();                        } catch (IOException ignore) {                        }                    }                }                log.debug("connect: Using atom '" + property.getPath()                    + "' with content type '" + contentType + "' for "                    + String.valueOf(contentLength) + " bytes");                // set the fields                setContentType(contentType);                setContentEncoding(contentEncoding);                setContentLength(contentLength);                setLastModified(lastModified);                // mark connection open                connected = true;            } catch (RepositoryException re) {                throw failure("connect", re.toString(), re);            }        }    }    /**     * Returns an input stream that reads from this open connection. If not     * entry path is specified in the URL, this method returns the input stream     * providing access to the archive as a whole. Otherwise the input stream     * returned is a <code>JarInputStream</code> positioned at the start of     * the named entry.     * <p>     * <b>NOTES:</b>     * <ul>     * <li>Each call to this method returns a new <code>InputStream</code>.     * <li>Do not forget to close the return stream when not used anymore for     *      the system to be able to free resources.     * </ul>     * <p>     * Calling this method implicitly calls {@link #connect()} to ensure the     * connection is open.     *     * @return The <code>InputStream</code> on the archive or the entry if     *      specified.     *     * @throws IOException if an error occurrs opening the connection through     *      {@link #connect()} or creating the <code>InputStream</code> on the     *      repository <code>Property</code>.     */    public InputStream getInputStream() throws IOException {        // get the input stream on the archive itself - also enforces connect()        InputStream ins = super.getInputStream();        // access the entry in the archive if defined        String entryPath = getEntryPath();        if (entryPath != null) {            // open the jar input stream            JarInputStream jins = new JarInputStream(ins);            // position at the correct entry            findEntry(jins, entryPath);            // return the input stream            return jins;        }        // otherwise just return the stream on the archive        return ins;    }    //----------- internal helper to find the entry ------------------------    /**     * Returns the <code>JarEntry</code> for the path from the     * <code>JarInputStream</code> or <code>null</code> if the path cannot     * be found in the archive.     *     * @param zins The <code>JarInputStream</code> to search in.     * @param path The path of the <code>JarEntry</code> to return.     *     * @return The <code>JarEntry</code> for the path or <code>null</code>     *      if no such entry can be found.     *     * @throws IOException if a problem occurrs reading from the stream.     */    static JarEntry findEntry(JarInputStream zins, String path)        throws IOException {        JarEntry entry = zins.getNextJarEntry();        while (entry != null) {            if (path.equals(entry.getName())) {                return entry;            }            entry = zins.getNextJarEntry();        }        // invariant : nothing found in the zip matching the path        return null;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品久久久男人的天堂| 欧美精品一级二级| 日本不卡中文字幕| 亚洲欧洲精品一区二区三区不卡| 欧美日韩高清一区二区不卡| 一本色道久久加勒比精品 | 欧美无砖砖区免费| 91在线porny国产在线看| 91蝌蚪porny| 在线观看av不卡| 欧美猛男男办公室激情| 91麻豆精品国产91久久久久久 | 麻豆91在线播放| 看国产成人h片视频| 国产一区不卡视频| 国产91丝袜在线播放| 成人在线一区二区三区| 色哟哟国产精品| 欧美一区二区视频在线观看2020 | 一区二区三区国产精华| 婷婷久久综合九色综合伊人色| 无码av免费一区二区三区试看 | 亚洲桃色在线一区| 亚洲国产一区二区在线播放| 日韩高清中文字幕一区| 激情深爱一区二区| 91视频免费观看| 日韩欧美国产不卡| 日本一区二区三区久久久久久久久不 | 91在线免费看| 欧美日韩国产精品自在自线| 久久影院午夜论| 伊人开心综合网| 激情综合色综合久久综合| 99久久777色| 日韩精品一区二区三区中文精品 | 亚洲一级二级在线| 美日韩一区二区三区| 99精品1区2区| 2023国产精品| 香蕉成人啪国产精品视频综合网| 国内一区二区视频| 欧美日本一区二区在线观看| 国产精品亲子乱子伦xxxx裸| 日欧美一区二区| 日本精品一级二级| 久久嫩草精品久久久精品一| 性感美女极品91精品| 99久久精品一区| 精品精品国产高清a毛片牛牛| 一区二区三区在线免费观看| 风间由美一区二区av101| 日韩欧美电影一区| 五月天中文字幕一区二区| 成人福利视频网站| 久久久久99精品一区| 免费成人小视频| 欧美嫩在线观看| 亚洲愉拍自拍另类高清精品| fc2成人免费人成在线观看播放 | 中文字幕亚洲精品在线观看| 蜜桃av一区二区| 欧美日韩日日骚| 一区二区三区免费在线观看| 成人黄色777网| 国产精品久久久久久久久久久免费看 | 亚洲国产视频一区| 不卡视频一二三| 国产日产精品一区| 国产精品18久久久久久久网站| 精品人伦一区二区色婷婷| 日本中文一区二区三区| 欧美久久久久久久久久| 午夜日韩在线电影| 在线综合亚洲欧美在线视频| 午夜精品免费在线| 91精品视频网| 麻豆国产精品官网| 26uuu国产一区二区三区| 国产乱码字幕精品高清av | 国产精品美女一区二区| 成人av电影在线网| 亚洲欧美日韩系列| 欧美在线观看视频一区二区三区 | 精品午夜久久福利影院 | 国产精品久久久久一区| a在线播放不卡| 亚洲乱码国产乱码精品精的特点| 色婷婷综合久色| 亚洲成人av一区二区| 日韩欧美国产麻豆| 成人一区二区三区中文字幕| 亚洲天堂网中文字| 欧美午夜精品理论片a级按摩| 亚洲国产精品人人做人人爽| 日韩一区二区免费在线电影| 国产成人综合亚洲91猫咪| 中文字幕一区二区在线观看| 一本大道av伊人久久综合| 亚洲大片在线观看| 精品国产一二三区| 91免费小视频| 精品制服美女丁香| 亚洲欧美偷拍卡通变态| 555www色欧美视频| 成人免费视频一区| 日韩av一级片| 亚洲品质自拍视频| 日韩欧美激情四射| 99r精品视频| 国产一区二区三区在线观看免费| 一区二区三区影院| 日韩久久免费av| 日本韩国欧美三级| 国产乱子轮精品视频| 伊人开心综合网| 日本一区二区三区国色天香| 欧美日韩久久一区二区| 成人av综合在线| 麻豆精品久久久| 亚洲一区二区三区三| 欧美国产综合一区二区| 日韩欧美综合在线| 在线看国产日韩| 99久久婷婷国产综合精品电影| 麻豆成人免费电影| 亚洲一区二区三区视频在线播放| 久久九九99视频| 日韩一区二区三区观看| 欧美亚洲高清一区| 91论坛在线播放| 夫妻av一区二区| 国产成人免费网站| 九色|91porny| 久久成人羞羞网站| 日韩黄色免费电影| 亚洲国产婷婷综合在线精品| 亚洲免费伊人电影| 国产精品视频免费看| 国产日韩欧美激情| 久久精品夜色噜噜亚洲aⅴ| 日韩午夜av电影| 欧美一级片在线观看| 4438亚洲最大| 欧美一区二区三区日韩| 欧美色老头old∨ideo| 欧洲激情一区二区| 色诱亚洲精品久久久久久| 99久久精品久久久久久清纯| eeuss鲁片一区二区三区| 成人国产在线观看| 99久久综合99久久综合网站| 丰满亚洲少妇av| k8久久久一区二区三区| 91免费看视频| 欧美午夜在线观看| 717成人午夜免费福利电影| 欧美精品欧美精品系列| 欧美挠脚心视频网站| 日韩免费高清视频| 国产偷国产偷亚洲高清人白洁| 国产女同互慰高潮91漫画| 国产精品久久久久婷婷二区次| 日韩理论片在线| 首页综合国产亚洲丝袜| 精品一区二区在线视频| 国产老女人精品毛片久久| 高清av一区二区| 色综合中文字幕国产| 一本大道久久a久久综合| 欧美日本精品一区二区三区| 精品久久久久久无| 国产精品国产自产拍高清av| 一区二区免费在线播放| 日本欧美一区二区三区乱码| 国产成人综合在线| 日本久久电影网| 欧美刺激午夜性久久久久久久| www国产精品av| 亚洲精品免费在线| 美女诱惑一区二区| 91丨九色丨黑人外教| 欧美日韩大陆一区二区| 国产午夜精品一区二区三区四区| 亚洲色图欧洲色图婷婷| 五月激情六月综合| 成人性生交大片| 777精品伊人久久久久大香线蕉| 久久久久久影视| 亚洲高清免费观看| 成人毛片视频在线观看| 欧美一级免费大片| 亚洲欧美色一区| 国产iv一区二区三区| 欧美精选午夜久久久乱码6080| 久久久影院官网| 青青草成人在线观看| 色综合久久66| 中文字幕av在线一区二区三区| 日本麻豆一区二区三区视频|