01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.wicket.util.resource.locator;
18:
19: import java.util.Locale;
20:
21: import org.apache.wicket.util.resource.IResourceStream;
22:
23: /**
24: * Interface for code that locates resources.
25: *
26: * @author Jonathan Locke
27: */
28: public interface IResourceStreamLocator {
29: /**
30: * Loads a resource, given a path and class. Typically this method is either
31: * called by external clients if they are not interested in a lookup that
32: * takes the style and locale into account, or it is called by the
33: * implementation of {@link #locate(Class, String, String, Locale, String)}
34: * where the latter just takes care of trying out the different combinations
35: * for the provided style and locale and uses this method to actually load
36: * the resource stream.
37: *
38: * @param clazz
39: * The class loader for delegating the loading of the resource
40: * @param path
41: * The path of the resource
42: *
43: * @return The resource or null
44: */
45: public IResourceStream locate(Class clazz, String path);
46:
47: /**
48: * Loads a resource, given a path, style, locale and extension.
49: *
50: * @param clazz
51: * The class loader for delegating the loading of the resource
52: * @param path
53: * The path of the resource
54: * @param style
55: * Any resource style, such as a skin style (see
56: * {@link org.apache.wicket.Session})
57: * @param locale
58: * The locale of the resource to load
59: * @param extension
60: * The extension of the resource
61: *
62: * @return The resource or null
63: */
64: public IResourceStream locate(Class clazz, String path,
65: String style, Locale locale, String extension);
66: }
|