1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package net.sf.tacos.asset;
18
19 import java.io.InputStream;
20
21 import org.apache.tapestry.IAsset;
22 import org.apache.hivemind.Resource;
23 import org.apache.hivemind.Location;
24 import org.apache.tapestry.services.AbsoluteURLBuilder;
25
26
27
28
29
30 public class AbsoluteAsset implements IAsset {
31
32 private IAsset asset;
33 private AbsoluteURLBuilder absoluteURLBuilder;
34
35 public AbsoluteAsset(IAsset asset, AbsoluteURLBuilder absoluteURLBuilder) {
36 this.asset = asset;
37 this.absoluteURLBuilder = absoluteURLBuilder;
38 }
39
40 public String buildURL() {
41 return absoluteURLBuilder.constructURL(asset.buildURL());
42 }
43
44 public InputStream getResourceAsStream() {
45 return asset.getResourceAsStream();
46 }
47
48 public Resource getResourceLocation() {
49 return asset.getResourceLocation();
50 }
51
52 public Location getLocation() {
53 return asset.getLocation();
54 }
55 }
56