Package com.atlassian.bitbucket.content
Class AbstractFileContentCallback
java.lang.Object
com.atlassian.bitbucket.content.AbstractFileContentCallback
- All Implemented Interfaces:
FileContentCallback
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
offerBlame
(Page<Blame> blames) If annotations were requested and at least oneline
was streamed, this method will be called beforeFileContentCallback.onEnd(FileSummary)
to provideblame
for the streamed lines.void
onBinary()
Called once if the file is binary.void
onEnd
(FileSummary summary) boolean
Ignores the provided line details and returnstrue
, which will continue streaming.void
onStart
(FileContext context) Called before the firstFileContentCallback.onLine(int, String, boolean)
.
-
Constructor Details
-
AbstractFileContentCallback
public AbstractFileContentCallback()
-
-
Method Details
-
offerBlame
Description copied from interface:FileContentCallback
If annotations were requested and at least oneline
was streamed, this method will be called beforeFileContentCallback.onEnd(FileSummary)
to provideblame
for the streamed lines.- Specified by:
offerBlame
in interfaceFileContentCallback
- Parameters:
blames
-blame
for the streamed lines- Throws:
IOException
- may be thrown by implementations which perform I/O.
-
onBinary
Description copied from interface:FileContentCallback
Called once if the file is binary. None of the other methods will be called.- Specified by:
onBinary
in interfaceFileContentCallback
- Throws:
IOException
- if the callback fails
-
onEnd
Description copied from interface:FileContentCallback
Called after the finalline
, andblame
if 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:
onEnd
in 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:
onLine
in 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:FileContentCallback
Called before the firstFileContentCallback.onLine(int, String, boolean)
.- Specified by:
onStart
in 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.
-