01: // Copyright 2006 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14:
15: package org.apache.tapestry;
16:
17: import org.apache.tapestry.ioc.Resource;
18:
19: /**
20: * An Asset is any kind of resource that can be exposed to the client web browser. Although quite
21: * often an Asset is a resource in a web application's context folder, within Tapestry, Assets may
22: * also be resources on the classpath (i.e., packaged inside JARs).
23: * <p>
24: * An Asset's toString() will return the URL for the resource (the same value as
25: * {@link #toClientURL()}).
26: */
27: public interface Asset {
28: /**
29: * Returns a URL that can be passed, unchanged, to the client in order for it to access the
30: * resource.
31: */
32: String toClientURL();
33:
34: /** Returns the underlying Resource for the Asset. */
35: Resource getResource();
36: }
|