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

Add option for omitting archive extension from exploded directory name

XMLWordPrintable

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

      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"
      

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

              Created:
              Updated:
              Resolved: