@FunctionalInterface public interface

BulkContentCallback

com.atlassian.bitbucket.scm.bulk.BulkContentCallback

Class Overview

Callback for streamed file content.

Note that there is no guarantee about the order in which the files are handed to the callback.

Summary

Public Methods
@Nonnull BulkContentDisposition accept(BulkFile file)
For each added, modified or deleted file, this method is called once with the metadata.
void onEnd(BulkContentSummary summary)
Called at the end.
void onFile(BulkFile file, InputStream content)
For each file where the content was requested with accept(BulkFile), this method is called.
void onStart(BulkContentContext context)
Called before any other methods are called.

Public Methods

@Nonnull public BulkContentDisposition accept (BulkFile file)

For each added, modified or deleted file, this method is called once with the metadata. This allows the callback to request content if it's interested in it or stop processing. If the callback signals that it wants the file's content, it will be provided to onFile(BulkFile, InputStream).

Parameters
file information about the file
Returns
  • an instruction to the caller about how to proceed

public void onEnd (BulkContentSummary summary)

Called at the end.

Parameters
summary provides details about the command execution

public void onFile (BulkFile file, InputStream content)

For each file where the content was requested with accept(BulkFile), this method is called.

Parameters
file information about the file
content the input stream of the contents; must be consumed before method returns (it won't stay usable after)

public void onStart (BulkContentContext context)

Called before any other methods are called.

Parameters
context provides details about the request