-
1. Re: Add a directory resource to the JavaArchive
aslak Jan 14, 2010 10:52 AM (in response to jaikiran)In this case, java.io.File means a actual file.
You could use the ExplodedImporter to import a directory into the archive.
This will import the directory into the root path:
{code}
archive.as(ExplodedImporter.class).importDirectory(java.io.File)
{code}
If you want it in a none root path, I think a import into a temp archive and a merge to the original one is your best bet at the moment.
{code}
Archive<?> javaArchive = Archives.create("test.jar", JavaArchive.class); Archive<?> archive = Archives.create("test.jar", ExplodedImporter.class).importDirectory(myDirecotry); javaArchive.merge(archive, Paths.create("location"));
{code} -
2. Re: Add a directory resource to the JavaArchive
aslak Jan 14, 2010 10:56 AM (in response to jaikiran)I created [SHRINKWRAP-117|https://jira.jboss.org/jira/browse/SHRINKWRAP-117] so we at least can document the usage.
-
3. Re: Add a directory resource to the JavaArchive
alrubinger Jan 14, 2010 11:06 AM (in response to jaikiran)Aslak and I have recently had some discussions with intent to clear up "ResourceContainer".
Either way, I think adding a File directory is a valid case; please make a JIRA.
As a workaround, check out ExplodedImporter to import the directory in as an Archive. From there you can combine archives.
S,
ALR -
4. Re: Add a directory resource to the JavaArchive
jaikiran Jan 14, 2010 11:17 AM (in response to aslak)Thanks, the ExplodedImporter approach worked