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

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

?? servletcontextresource.java

?? spring framework 2.5.4源代碼
?? JAVA
字號(hào):
/*
 * Copyright 2002-2008 the original author or authors.
 *
 * Licensed 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.springframework.web.context.support;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;

import javax.servlet.ServletContext;

import org.springframework.core.io.AbstractResource;
import org.springframework.core.io.ContextResource;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.web.util.WebUtils;

/**
 * {@link org.springframework.core.io.Resource} implementation for
 * {@link javax.servlet.ServletContext} resources, interpreting
 * relative paths within the web application root directory.
 *
 * <p>Always supports stream access and URL access, but only allows
 * <code>java.io.File</code> access when the web application archive
 * is expanded.
 *
 * @author Juergen Hoeller
 * @since 28.12.2003
 * @see javax.servlet.ServletContext#getResourceAsStream
 * @see javax.servlet.ServletContext#getResource
 * @see javax.servlet.ServletContext#getRealPath
 */
public class ServletContextResource extends AbstractResource implements ContextResource {

	private final ServletContext servletContext;

	private final String path;


	/**
	 * Create a new ServletContextResource.
	 * <p>The Servlet spec requires that resource paths start with a slash,
	 * even if many containers accept paths without leading slash too.
	 * Consequently, the given path will be prepended with a slash if it
	 * doesn't already start with one.
	 * @param servletContext the ServletContext to load from
	 * @param path the path of the resource
	 */
	public ServletContextResource(ServletContext servletContext, String path) {
		// check ServletContext
		Assert.notNull(servletContext, "Cannot resolve ServletContextResource without ServletContext");
		this.servletContext = servletContext;

		// check path
		Assert.notNull(path, "Path is required");
		if (!path.startsWith("/")) {
			path = "/" + path;
		}
		this.path = StringUtils.cleanPath(path);
	}

	/**
	 * Return the ServletContext for this resource.
	 */
	public final ServletContext getServletContext() {
		return this.servletContext;
	}

	/**
	 * Return the path for this resource.
	 */
	public final String getPath() {
		return this.path;
	}


	/**
	 * This implementation checks <code>ServletContext.getResource</code>.
	 * @see javax.servlet.ServletContext#getResource(String)
	 */
	public boolean exists() {
		try {
			URL url = this.servletContext.getResource(this.path);
			return (url != null);
		}
		catch (MalformedURLException ex) {
			return false;
		}
	}

	/**
	 * This implementation delegates to <code>ServletContext.getResourceAsStream</code>,
	 * but throws a FileNotFoundException if no resource found.
	 * @see javax.servlet.ServletContext#getResourceAsStream(String)
	 */
	public InputStream getInputStream() throws IOException {
		InputStream is = this.servletContext.getResourceAsStream(this.path);
		if (is == null) {
			throw new FileNotFoundException("Could not open " + getDescription());
		}
		return is;
	}

	/**
	 * This implementation delegates to <code>ServletContext.getResource</code>,
	 * but throws a FileNotFoundException if no resource found.
	 * @see javax.servlet.ServletContext#getResource(String)
	 */
	public URL getURL() throws IOException {
		URL url = this.servletContext.getResource(this.path);
		if (url == null) {
			throw new FileNotFoundException(
					getDescription() + " cannot be resolved to URL because it does not exist");
		}
		return url;
	}

	/**
	 * This implementation delegates to <code>ServletContext.getRealPath</code>,
	 * but throws a FileNotFoundException if not found or not resolvable.
	 * @see javax.servlet.ServletContext#getRealPath(String)
	 */
	public File getFile() throws IOException {
		String realPath = WebUtils.getRealPath(this.servletContext, this.path);
		return new File(realPath);
	}

	/**
	 * This implementation creates a ServletContextResource, applying the given path
	 * relative to the path of the underlying file of this resource descriptor.
	 * @see org.springframework.util.StringUtils#applyRelativePath(String, String)
	 */
	public Resource createRelative(String relativePath) {
		String pathToUse = StringUtils.applyRelativePath(this.path, relativePath);
		return new ServletContextResource(this.servletContext, pathToUse);
	}

	/**
	 * This implementation returns the name of the file that this ServletContext
	 * resource refers to.
	 * @see org.springframework.util.StringUtils#getFilename(String)
	 */
	public String getFilename() {
		return StringUtils.getFilename(this.path);
	}

	/**
	 * This implementation returns a description that includes the ServletContext
	 * resource location.
	 */
	public String getDescription() {
		return "ServletContext resource [" + this.path + "]";
	}

	public String getPathWithinContext() {
		return this.path;
	}


	/**
	 * This implementation compares the underlying ServletContext resource locations.
	 */
	public boolean equals(Object obj) {
		if (obj == this) {
			return true;
		}
		if (obj instanceof ServletContextResource) {
			ServletContextResource otherRes = (ServletContextResource) obj;
			return (this.servletContext.equals(otherRes.servletContext) && this.path.equals(otherRes.path));
		}
		return false;
	}

	/**
	 * This implementation returns the hash code of the underlying
	 * ServletContext resource location.
	 */
	public int hashCode() {
		return this.path.hashCode();
	}

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产不卡免费视频| 亚洲最新视频在线观看| 亚洲国产精品成人综合| 欧美国产激情二区三区| 亚洲人成精品久久久久久| 天天影视网天天综合色在线播放| 美日韩黄色大片| 国产激情视频一区二区在线观看| a在线播放不卡| 欧美美女直播网站| 日韩亚洲欧美成人一区| 国产欧美精品国产国产专区| 亚洲免费观看高清完整版在线观看熊| 亚洲国产日韩综合久久精品| 精品亚洲porn| 色噜噜久久综合| 欧美成人精精品一区二区频| 国产精品女同一区二区三区| 日韩一区精品字幕| 成人avav在线| 日韩欧美国产一区在线观看| 国产精品久久三| 麻豆一区二区三区| 色婷婷综合久久久久中文 | 国产精品久久久久久久午夜片| 午夜成人免费电影| 粉嫩av一区二区三区| 91精品国产麻豆| 亚洲婷婷综合色高清在线| 秋霞影院一区二区| 99re66热这里只有精品3直播 | 狠狠色2019综合网| 日本高清不卡aⅴ免费网站| 精品国产91洋老外米糕| 一区二区在线免费| 成人动漫中文字幕| 欧美一区二区三区小说| 尤物视频一区二区| 成人网在线免费视频| 91精品国产综合久久精品性色 | 欧日韩精品视频| 国产女人18水真多18精品一级做| 亚洲电影激情视频网站| 91色乱码一区二区三区| 久久久久久久网| 美女www一区二区| 日本大香伊一区二区三区| 久久精品夜色噜噜亚洲a∨| 日韩和欧美一区二区三区| 99视频有精品| 国产日韩成人精品| 久久99精品久久久久婷婷| 欧美日韩电影在线播放| 成人免费一区二区三区在线观看| 国产乱码一区二区三区| 欧美mv和日韩mv国产网站| 天天做天天摸天天爽国产一区| 一本色道久久综合亚洲91| 中文字幕不卡在线观看| 国产在线国偷精品免费看| 欧美一区二区三区性视频| 五月婷婷综合激情| 欧美日韩三级一区二区| 玉足女爽爽91| 色综合久久88色综合天天| 亚洲婷婷在线视频| 色婷婷香蕉在线一区二区| 国产欧美日韩视频在线观看| 久久99久久精品| 日韩精品一区二区三区视频| 日韩和欧美一区二区| 91精品国产欧美一区二区| 丝袜美腿亚洲色图| 911精品产国品一二三产区 | 91精品国产一区二区| 五月综合激情网| 欧美高清www午色夜在线视频| 亚洲一区二区中文在线| 欧美亚洲一区二区在线| 亚洲国产日韩一级| 欧美日韩激情一区二区| 日本不卡一区二区三区高清视频| 欧美精品免费视频| 麻豆精品精品国产自在97香蕉 | 国产在线看一区| 久久久99精品久久| 成人的网站免费观看| 国产精品私房写真福利视频| 成人短视频下载| 亚洲影院在线观看| 91精品国产全国免费观看| 久久99热国产| 国产午夜三级一区二区三| 99国内精品久久| 亚洲一二三四久久| 日韩欧美中文一区二区| 精品一区二区三区久久| 国产精品亲子乱子伦xxxx裸| 91国偷自产一区二区开放时间 | 91视频免费播放| 午夜欧美大尺度福利影院在线看| 欧美一区永久视频免费观看| 精品一区二区三区在线视频| 国产欧美日韩一区二区三区在线观看| 9色porny自拍视频一区二区| 亚洲精品va在线观看| 日韩亚洲欧美一区二区三区| 国产aⅴ综合色| 亚洲一线二线三线久久久| 欧美变态口味重另类| aa级大片欧美| 视频一区国产视频| 国产拍欧美日韩视频二区| 色狠狠色狠狠综合| 老司机精品视频在线| 亚洲图片你懂的| 欧美大片一区二区| 成人动漫中文字幕| 日本成人超碰在线观看| 一区在线观看视频| 91精品国产美女浴室洗澡无遮挡| 国产成人鲁色资源国产91色综| 亚洲一区二区三区激情| 久久亚洲一区二区三区明星换脸| 成人激情综合网站| 日本vs亚洲vs韩国一区三区二区| 国产精品情趣视频| 日韩一区二区三区视频| 99久久久久久99| 麻豆精品新av中文字幕| 亚洲精品日日夜夜| 久久久久久久久久电影| 欧洲在线/亚洲| 国产高清不卡一区二区| 亚洲高清中文字幕| 欧美极品另类videosde| 5566中文字幕一区二区电影| a亚洲天堂av| 狠狠色丁香九九婷婷综合五月| 亚洲一二三级电影| 亚洲aⅴ怡春院| 中文字幕一区在线| 欧美精品一区二| 欧美丰满美乳xxx高潮www| 成人h动漫精品一区二| 日本v片在线高清不卡在线观看| 亚洲人成人一区二区在线观看| 久久婷婷国产综合国色天香 | 日本一区中文字幕| 亚洲人妖av一区二区| 亚洲精品一区二区三区四区高清 | 日韩影视精彩在线| 一区二区欧美视频| 国产精品视频观看| 欧美不卡在线视频| 欧美久久久一区| 色综合久久中文综合久久牛| 色婷婷av一区二区三区gif| 国产寡妇亲子伦一区二区| 人人爽香蕉精品| 午夜伊人狠狠久久| 亚洲精品美腿丝袜| 国产精品久久久久久福利一牛影视| 欧美大度的电影原声| 91麻豆精品久久久久蜜臀| 在线精品视频一区二区| 95精品视频在线| 粉嫩av一区二区三区在线播放| 久久se这里有精品| 麻豆成人免费电影| 日韩在线一二三区| 日韩国产欧美在线播放| 性做久久久久久| 亚洲国产视频一区二区| 亚洲五码中文字幕| 亚洲一区影音先锋| 亚洲美女屁股眼交| 一区二区三区欧美激情| 亚洲天堂成人在线观看| 亚洲欧洲无码一区二区三区| 中文字幕va一区二区三区| 久久午夜羞羞影院免费观看| 欧美岛国在线观看| 久久女同精品一区二区| 久久这里只有精品视频网| 精品久久一区二区| 久久久精品tv| 国产目拍亚洲精品99久久精品| 中文字幕不卡一区| 最新热久久免费视频| 综合久久久久久| 一区二区三区**美女毛片| 亚洲国产三级在线| 日本视频免费一区| 精品在线一区二区三区| 国产成人午夜精品影院观看视频 | 自拍偷拍亚洲综合| 亚洲码国产岛国毛片在线| 亚洲综合免费观看高清完整版| 亚洲午夜成aⅴ人片|