001 /** 002 * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.kernel.url; 016 017 import java.net.URL; 018 019 import java.util.Set; 020 021 /** 022 * @author Raymond Aug?? 023 */ 024 public interface URLContainer { 025 026 /** 027 * Returns the resource with the given name. A resource is data that can be 028 * accessed in a way that is independent of the location or storage. 029 * 030 * <p> 031 * The name is a slash (<code>/</code>) separated path that identifies the 032 * resource. 033 * </p> 034 * 035 * @param name the resource name 036 * @return the URL used for reading the resource, or <code>null</code> if 037 * the resource is not found or if the invoker does not have 038 * adequate privileges to get the resource 039 */ 040 public URL getResource(String name); 041 042 /** 043 * Returns the directory-like listing of all the paths to resources within 044 * the container whose longest sub-path matches the given path. Resources 045 * that the invoker does not have access to are not included. If no 046 * resources are found, an empty set is returned. 047 * 048 * <p> 049 * Paths indicating sub-directory paths end with a slash (<code>/</code>). A 050 * path can be passed to the {@link #getResource(String)} method to return a 051 * resource URL. 052 * </p> 053 * 054 * @param path the resource path 055 * @return the paths representing individual resources in the container 056 */ 057 public Set<String> getResources(String path); 058 059 }