code: @Override
      public <X extends Archive<X>> X getAsType(Class<X> type, ArchivePath path, final ArchiveFormat archiveFormat) {
          Validate.notNull(type, "Type must be specified");
          Validate.notNull(path, "ArchivePath must be specified");
          Validate.notNull(archiveFormat, "ArchiveFormat must be specified");
  
          // Get stream importer/exporter bindings for specified format
          final ArchiveFormatStreamBindings formatBinding = new ArchiveFormatStreamBindings(archiveFormat);
  
          Node content = get(path);
          if (content == null) {
              return null;
          }
  
          Asset asset = content.getAsset();
          if (asset == null) {
              return null;
          }
          // If we already have an archive asset, just return it as-is; don't reimport
          if (asset.getClass() == ArchiveAsset.class) {
              return ArchiveAsset.class.cast(asset).getArchive().as(type);
          }
  
          InputStream stream = null;
          try {
              stream = asset.openStream();
              X archive = ShrinkWrap.create(formatBinding.getImporter(), path.get()).importFrom(stream).as(type);
              delete(path);
              add(new ArchiveAsset(archive, formatBinding.getExporter()), path);
  
              return archive;
          } finally {
              if (stream != null) {
                  try {
                      stream.close();
                  } catch (IOException e) {
                      throw new ArchiveImportException("Stream not closed after import", e);
                  }
              }
          }
      }
docs: {@inheritDoc}
  
  @see org.jboss.shrinkwrap.api.Archive#getAsType(java.lang.Class, org.jboss.shrinkwrap.api.ArchivePath,
  org.jboss.shrinkwrap.api.ArchiveFormat)