[
https://issues.jboss.org/browse/SHRINKWRAP-304?page=com.atlassian.jira.pl...
]
Andrew Rubinger commented on SHRINKWRAP-304:
--------------------------------------------
Instead propose overloading like:
{code}File explodedDirectory =
webArchive.as(ExplodedExporter.class).exportExploded(parentDirectory,
"newFileName");{code}
WDYT? Ian, would you like to take a stab at this?
Add option for omitting archive extension from exploded directory
name
----------------------------------------------------------------------
Key: SHRINKWRAP-304
URL:
https://issues.jboss.org/browse/SHRINKWRAP-304
Project: ShrinkWrap
Issue Type: Enhancement
Components: api
Affects Versions: 1.0.0-beta-2
Reporter: Ian Brandt
It would be nice if ExplodedExporter offered the option of omitting the archive extension
from the exploded directory name.
h5. Current Method:
{code:java}
/**
* Exports provided archive as an exploded directory structure.
*
* @param archive
* @param parentDirectory Must be a folder
* @return File for exploded archive contents
* @throws IllegalArgumentException if the archive or parent directory not valid
* @throws ArchiveExportException if the export process fails
*/
File exportExploded(File parentDirectory);
{code}
h5. Current Example:
{code:java}
Archive webArchive = ShrinkWrap.create(WebArchive.class, "test.war");
File explodedDirectory =
webArchive.as(ExplodedExporter.class).exportExploded(tmpDirectory);
System.out.println(explodedDirectory.getName()) // "test.war"
{code}
h5. Proposed Method Overload:
{code:java}
/**
* Exports provided archive as an exploded directory structure.
*
* @param archive
* @param parentDirectory Must be a folder
* @param omitExtension Whether to omit the archive extension from the exploded directory
name
* @return File for exploded archive contents
* @throws IllegalArgumentException if the archive or parent directory not valid
* @throws ArchiveExportException if the export process fails
*/
File exportExploded(File parentDirectory, boolean omitExtension);
{code}
h5. Proposed Example
{code:java}
Archive webArchive = ShrinkWrap.create(WebArchive.class, "test.war");
File explodedDirectory =
webArchive.as(ExplodedExporter.class).exportExploded(tmpDirectory, true);
System.out.println(explodedDirectory.getName()) // "test"
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira