@FunctionalInterface public interface

LastModifiedCallback

com.atlassian.bitbucket.commit.LastModifiedCallback

Class Overview

Describes a callback for receiving the commits that last modified a set of files.

Summary

Public Methods
void onEnd(LastModifiedSummary summary)
Called after the final file's last modification has been streamed.
boolean onFile(String file, Commit commit)
Receives a fully-populated commit which last modified the specified file.
void onStart(LastModifiedContext context)
Called before the first file is streamed.

Public Methods

public void onEnd (LastModifiedSummary summary)

Called after the final file's last modification has been streamed.

Note: If the requested path contained no files, this method may be called immediately after onStart(LastModifiedContext) without any calls to onFile(String, Commit).

Parameters
summary summarizes the request and provides the most recent commit to modify the requested path
Throws
IOException for implementations which perform I/O

public boolean onFile (String file, Commit commit)

Receives a fully-populated commit which last modified the specified file. Files are provided as relative to the requested path, and only files are provided. Subdirectories of the requested path are not streamed.

This method will never be invoked before onStart(LastModifiedContext), and if it is invoked onEnd(LastModifiedSummary) is guaranteed to be invoked, whether the end happens because this method returns false or because the upstream sender runs out of modifications.

Parameters
file a relative path to the modified file
commit the last commit to modify the file
Returns
  • true if more modifications should be provided; otherwise, false to end streaming, potentially leaving some number of modifications unread
Throws
IOException

public void onStart (LastModifiedContext context)

Called before the first file is streamed.

Parameters
context provides details about the request
Throws
IOException for implementations which perform I/O