001/*
002 * Copyright 2002-2007 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.core.io;
018
019/**
020 * Extended interface for a resource that is loaded from an enclosing
021 * 'context', e.g. from a {@link javax.servlet.ServletContext} or a
022 * {@link javax.portlet.PortletContext} but also from plain classpath paths
023 * or relative file system paths (specified without an explicit prefix,
024 * hence applying relative to the local {@link ResourceLoader}'s context).
025 *
026 * @author Juergen Hoeller
027 * @since 2.5
028 * @see org.springframework.web.context.support.ServletContextResource
029 * @see org.springframework.web.portlet.context.PortletContextResource
030 */
031public interface ContextResource extends Resource {
032
033        /**
034         * Return the path within the enclosing 'context'.
035         * <p>This is typically path relative to a context-specific root directory,
036         * e.g. a ServletContext root or a PortletContext root.
037         */
038        String getPathWithinContext();
039
040}