| 1 |
|
package org.trails.component.blob; |
| 2 |
|
|
| 3 |
|
import org.apache.tapestry.asset.AbstractAsset; |
| 4 |
|
import org.apache.tapestry.engine.ILink; |
| 5 |
|
import org.trails.descriptor.IPropertyDescriptor; |
| 6 |
|
|
| 7 |
|
import java.io.InputStream; |
| 8 |
|
import java.io.Serializable; |
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
public class TrailsBlobAsset extends AbstractAsset |
| 14 |
|
{ |
| 15 |
|
|
| 16 |
|
private BlobDownloadService bytesService; |
| 17 |
|
|
| 18 |
|
private Serializable id; |
| 19 |
|
|
| 20 |
|
private IPropertyDescriptor propertyDescriptor; |
| 21 |
|
|
| 22 |
|
public TrailsBlobAsset(BlobDownloadService chartService, IPropertyDescriptor propertyDescriptor, Serializable id) |
| 23 |
|
{ |
| 24 |
0 |
super(null, null); |
| 25 |
0 |
this.bytesService = chartService; |
| 26 |
0 |
this.id = id; |
| 27 |
0 |
this.propertyDescriptor = propertyDescriptor; |
| 28 |
0 |
} |
| 29 |
|
|
| 30 |
|
public IPropertyDescriptor getPropertyDescriptor() |
| 31 |
|
{ |
| 32 |
0 |
return propertyDescriptor; |
| 33 |
|
} |
| 34 |
|
|
| 35 |
|
public Serializable getId() |
| 36 |
|
{ |
| 37 |
0 |
return id; |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
public String buildURL() |
| 41 |
|
{ |
| 42 |
0 |
ILink l = bytesService.getLink(false, new Object[]{this}); |
| 43 |
0 |
return l.getURL(); |
| 44 |
|
} |
| 45 |
|
|
| 46 |
|
public InputStream getResourceAsStream() |
| 47 |
|
{ |
| 48 |
0 |
return null; |
| 49 |
|
} |
| 50 |
|
} |