Package com.atlassian.bitbucket.content
Class AbstractFileContentCallback
java.lang.Object
com.atlassian.bitbucket.content.AbstractFileContentCallback
- All Implemented Interfaces:
FileContentCallback
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidofferBlame(Page<Blame> blames) If annotations were requested and at least onelinewas streamed, this method will be called beforeFileContentCallback.onEnd(FileSummary)to provideblamefor the streamed lines.voidonBinary()Called once if the file is binary.voidonEnd(FileSummary summary) booleanIgnores the provided line details and returnstrue, which will continue streaming.voidonStart(FileContext context) Called before the firstFileContentCallback.onLine(int, String, boolean).
-
Constructor Details
-
AbstractFileContentCallback
public AbstractFileContentCallback()
-
-
Method Details
-
offerBlame
Description copied from interface:FileContentCallbackIf annotations were requested and at least onelinewas streamed, this method will be called beforeFileContentCallback.onEnd(FileSummary)to provideblamefor the streamed lines.- Specified by:
offerBlamein interfaceFileContentCallback- Parameters:
blames-blamefor the streamed lines- Throws:
IOException- may be thrown by implementations which perform I/O.
-
onBinary
Description copied from interface:FileContentCallbackCalled once if the file is binary. None of the other methods will be called.- Specified by:
onBinaryin interfaceFileContentCallback- Throws:
IOException- if the callback fails
-
onEnd
Description copied from interface:FileContentCallbackCalled after the finalline, andblameif requested, has been streamed.Note: If there were no lines, this method may be called immediately after
FileContentCallback.onStart(FileContext)without any calls toFileContentCallback.onLine(int, String, boolean).- Specified by:
onEndin interfaceFileContentCallback- Parameters:
summary- summarizes the file request and the streamed lines- Throws:
IOException- may be thrown by implementations which perform I/O.
-
onLine
Ignores the provided line details and returnstrue, which will continue streaming.- Specified by:
onLinein interfaceFileContentCallback- Parameters:
lineNumber- the line number of the line in the fileline- a truncated line of code. The line character limit can be set at a system level via a system propertytruncated- where the received line was truncated- Returns:
true- Throws:
IOException- may be thrown by derived classes
-
onStart
Description copied from interface:FileContentCallbackCalled before the firstFileContentCallback.onLine(int, String, boolean).- Specified by:
onStartin interfaceFileContentCallback- Parameters:
context- provides details about the file request for which lines are being streamed- Throws:
IOException- may be thrown by implementations which perform I/O.
-