2 Replies Latest reply: Oct 26, 2010 3:22 AM by Dan Allen RSS

More read methods

Dan Allen Master

While using the ShrinkWrap API to manipulate archives in the Arquillian deployment packager, I felt a real lack of read method options on the archive types. A prime example is when I want to read the WebArchives that are contained within an EnterpriseArchive.

 

My first thought was that I could use a filter to isolate the content I wanted. However, the Filter API doesn't seem to support an archive type. Perhaps it's just a matter of creating a new Filter implementation that first finds all nested archives and then passes that to the callback method for further filtering.

 

I think it would also be nice to have convenience methods on EnterpriseArchive to get all the modules and the modules by type.

 

Set<WebArchive> EnterpriseArchive#getModules()
Set<WebArchive> EnterpriseArchive#getWebModules()
Set<WebArchive> EnterpriseArchive#getEjbModules()

 

Then expand this set for the absolutely core structures of the different types. Forcing everything through getContent(Filter<T>) is a touch tedious