public interface

ContentTreeCallback

com.atlassian.stash.content.ContentTreeCallback
Known Indirect Subclasses

Class Overview

Callback interface for streaming content tree nodes from a starting directory

Note: Implementors are strongly encouraged to extend from AbstractContentTreeCallback. This interface will change, over time, and any class implementing it directly will be broken by such changes. Extending from the abstract class will help prevent such breakages.

Summary

Public Methods
@Deprecated void onEndPage(Page<?> page)
This method is deprecated. in 2.10 for removal in 3.0. Callbacks should extend AbstractContentTreeCallback and implement onEnd(ContentTreeSummary) instead.
@Deprecated void onStartPage(int index)
This method is deprecated. in 2.10 for removal in 3.0. Callbacks should extend AbstractContentTreeCallback and implement onStart(ContentTreeContext) instead.
@Deprecated boolean onTreeNode(String contentId, String path, ContentTreeNode.Type type)
This method is deprecated. in 2.10 for removal in 3.0. Callbacks should extend AbstractContentTreeCallback and implement onTreeNode(ContentTreeNode) instead.

Public Methods

@Deprecated public void onEndPage (Page<?> page)

This method is deprecated.
in 2.10 for removal in 3.0. Callbacks should extend AbstractContentTreeCallback and implement onEnd(ContentTreeSummary) instead.

Called after onStartPage(int), after onTreeNode(String, String, ContentTreeNode.Type) is invoked for the last time.

onEnd(ContentTreeSummary) will replace this method in Stash 3.0.

Parameters
page information about the page streamed to the callback. The page.getValues() will return null as the callback has already received the data. This is used to know information about the number of elements processed and whether there is more content to be retrieved in the future
Throws
IOException if the callback fails

@Deprecated public void onStartPage (int index)

This method is deprecated.
in 2.10 for removal in 3.0. Callbacks should extend AbstractContentTreeCallback and implement onStart(ContentTreeContext) instead.

Called before the first invocation of onTreeNode(String, String, ContentTreeNode.Type). It provides the callback the index of the starting element of the page.

onStart(ContentTreeContext) will replace this method in Stash 3.0. Until 3.0, the starting index can be retrieved using the deprecated getStart(). Plugin developers should implement onEnd(ContentTreeSummary) and use the ContentTreeSummary to retrieve paging details.

Parameters
index the index of the starting element of the page
Throws
IOException if the callback fails

@Deprecated public boolean onTreeNode (String contentId, String path, ContentTreeNode.Type type)

This method is deprecated.
in 2.10 for removal in 3.0. Callbacks should extend AbstractContentTreeCallback and implement onTreeNode(ContentTreeNode) instead.

Called once for each file path. onStartPage(int) is called before any invocation of this method. onEndPage(Page) is called after all invocations of this method.

Parameters
contentId a unique identifier for the content node
path the path to the content node
type the type of the content node
Returns
  • true if additional nodes should be provided; otherwise, false if the provided node should be the last
Throws
IOException may be thrown by implementations which perform I/O operations, such as streaming tree nodes