Uploaded image for project: 'ShrinkWrap'
  1. ShrinkWrap
  2. SHRINKWRAP-304

Add option for omitting archive extension from exploded directory name

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 1.0.0-beta-6
    • 1.0.0-beta-2
    • api
    • None

    Description

      It would be nice if ExplodedExporter offered the option of omitting the archive extension from the exploded directory name.

      Current Method:
      /**
       * 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);
      
      Current Example:
      Archive webArchive = ShrinkWrap.create(WebArchive.class, "test.war");
      File explodedDirectory = webArchive.as(ExplodedExporter.class).exportExploded(tmpDirectory);
      System.out.println(explodedDirectory.getName()) // "test.war"
      
      Proposed Method Overload:
      /**
       * 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);
      
      Proposed Example
      Archive webArchive = ShrinkWrap.create(WebArchive.class, "test.war");
      File explodedDirectory = webArchive.as(ExplodedExporter.class).exportExploded(tmpDirectory, true);
      System.out.println(explodedDirectory.getName()) // "test"
      

      Attachments

        Issue Links

          Activity

            People

              ddalto@redhat.com Davide D'Alto (Inactive)
              ianbrandt Ian Brandt (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: