[
https://issues.jboss.org/browse/SHRINKWRAP-496?page=com.atlassian.jira.pl...
]
Aslak Knutsen edited comment on SHRINKWRAP-496 at 11/30/15 6:17 PM:
--------------------------------------------------------------------
It could technically be implemented as a Handler, but I don't think we have any way to
globally register a Handler. Or register it dynamically for that matter.
{code}
archive.addHandlers(new ArchiveEventHandler() {
public void handle(ArchiveEvent event) {
if(event.getAsset() instanceOf URLAsset) {
// lookup cache / cache content
event.setHandledAsset(new FileAsset(cachedFile));
}
}
})
{code}
was (Author: aslak):
It could technically be implemented as a Handler, but I don't think we have any way to
globally register a Handler. Or register it dynamically for that matter.
{code}
archive.addHandlers(new ArchiveEventHandler() {
public void handle(ArchiveEvent event) {
if(event.getAsset() instanceOf URLAsset) {
// lookup cache / cache content
event.setHandledAsset(new FIleAsset(cachedFile));
}
}
})
{code}
Implement CacheUrlAsset
-----------------------
Key: SHRINKWRAP-496
URL:
https://issues.jboss.org/browse/SHRINKWRAP-496
Project: ShrinkWrap
Issue Type: Feature Request
Components: api
Affects Versions: 1.2.3
Reporter: Alex Soto
Priority: Minor
In ShrinkWrap UrlAsset downloaded an asset from a URL, which can be external and then it
creates the Archive element with that info. The problem is that sometimes you might want
to download a big file (2MB) to put inside an Archive, and this means that for each test
class that you execute you end up by downloading this file.
A possible solution could be create a CacheUrlAsset that downloads the content and stores
it in {java.io.tmp}/shrinkwrap so in successive calls before downloading the file again,
it can take it directly from cache directory.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)