1 /* 2 * Copyright 2002-2007 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.springframework.core.io; 18 19 /** 20 * Extended interface for a resource that is loaded from an enclosing 21 * 'context', e.g. from a {@link javax.servlet.ServletContext} or a 22 * {@link javax.portlet.PortletContext} but also from plain classpath paths 23 * or relative file system paths (specified without an explicit prefix, 24 * hence applying relative to the local {@link ResourceLoader}'s context). 25 * 26 * @author Juergen Hoeller 27 * @since 2.5 28 * @see org.springframework.web.context.support.ServletContextResource 29 * @see org.springframework.web.portlet.context.PortletContextResource 30 */ 31 public interface ContextResource extends Resource { 32 33 /** 34 * Return the path within the enclosing 'context'. 35 * <p>This is typically path relative to a context-specific root directory, 36 * e.g. a ServletContext root or a PortletContext root. 37 */ 38 String getPathWithinContext(); 39 40 }