|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tapestry.asset.AssetService
A service for building URLs to and accessing IAsset
s. Most of the
work is deferred to the IAsset
instance.
The retrieval part is directly linked to PrivateAsset
. The service responds to a URL
that encodes the path of a resource within the classpath. The
service(IRequestCycle, ResponseOutputStream)
method reads the resource and streams it
out.
TBD: Security issues. Should only be able to retrieve a resource that was previously registerred in some way ... otherwise, hackers will be able to suck out the .class files of the application!
Constructor Summary | |
AssetService()
|
Method Summary | |
ILink |
getLink(IRequestCycle cycle,
java.lang.Object parameter)
Builds a ILink for a PrivateAsset . |
java.lang.String |
getName()
Returns the name of the service. |
void |
service(IRequestCycle cycle,
ResponseOutputStream output)
Retrieves a resource from the classpath and returns it to the client in a binary output stream. |
void |
setAssetExternalizer(AssetExternalizer assetExternalizer)
|
void |
setClassResolver(org.apache.hivemind.ClassResolver classResolver)
|
void |
setExceptionReporter(RequestExceptionReporter exceptionReporter)
|
void |
setLinkFactory(LinkFactory linkFactory)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AssetService()
Method Detail |
public ILink getLink(IRequestCycle cycle, java.lang.Object parameter)
ILink
for a PrivateAsset
.
A single parameter is expected, the resource path of the asset (which is expected to start with a leading slash).
getLink
in interface IEngineService
cycle
- Defines the request cycle being processed.parameter
- An object that provide any additional information needed by the service. Each
service implementation will expect that an object of the proper type be passed in.
In some cases, a simple String will do; in others, a specific object (possibly
implementing an interface) will be required.
HttpServletResponse.encodeURL(java.lang.String)
.public java.lang.String getName()
IEngineService
getName
in interface IEngineService
public void service(IRequestCycle cycle, ResponseOutputStream output) throws javax.servlet.ServletException, java.io.IOException
TBD: Security issues. Hackers can download .class files.
service
in interface IEngineService
cycle
- the incoming requestoutput
- stream to which output should ultimately be directed
javax.servlet.ServletException
java.io.IOException
IEngine.service(org.apache.tapestry.request.RequestContext)
public void setExceptionReporter(RequestExceptionReporter exceptionReporter)
public void setAssetExternalizer(AssetExternalizer assetExternalizer)
public void setLinkFactory(LinkFactory linkFactory)
public void setClassResolver(org.apache.hivemind.ClassResolver classResolver)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |