public interface

ExportSection

com.atlassian.bitbucket.migration.ExportSection
Known Indirect Subclasses

Class Overview

Allows addition of entries to the export archive, either from disk or directly from a OutputStream stream.

Summary

Public Methods
void addEntriesAsArchive(Path entryName, IoConsumer<SequentialArchive> writer, boolean compress)
Adds entries packaged as an archive to the export archive
void addEntry(Path entryName, IoConsumer<OutputStream> writer, boolean compress)
Creates a file with the given entryName under this section of the export archive, then consumes the OutputStream it obtains from the file, using the given Consumer
static IoConsumer<SequentialArchive> emptyArchive()
Returns a consumer for SequentialArchive that adds no entries to the archive.
static IoConsumer<OutputStream> emptyEntry()
Returns a consumer for OutputStream that does not write any data.

Public Methods

public void addEntriesAsArchive (Path entryName, IoConsumer<SequentialArchive> writer, boolean compress)

Adds entries packaged as an archive to the export archive

Parameters
entryName the name to give this entry
writer used to write the contents of the entry (as an archive file)
compress whether to compress the contents of the entry
Throws
when an unrecoverable exception occurs when writing to the archive

public void addEntry (Path entryName, IoConsumer<OutputStream> writer, boolean compress)

Creates a file with the given entryName under this section of the export archive, then consumes the OutputStream it obtains from the file, using the given Consumer

Parameters
entryName the entryName of the file to be created. Use Paths#get(String, String...) to use this method efficiently.
writer consumes the OutputStream to add an entry to the archive
compress whether to compress the entry when adding it to the archive
Throws
when an unrecoverable exception occurs when writing to the archive

public static IoConsumer<SequentialArchive> emptyArchive ()

Returns a consumer for SequentialArchive that adds no entries to the archive.

Returns
  • a consumer that adds no entries

public static IoConsumer<OutputStream> emptyEntry ()

Returns a consumer for OutputStream that does not write any data.

Returns
  • a consumer that does not write any data