Package com.atlassian.bitbucket.avatar
Class SimpleAvatarSupplier
java.lang.Object
com.atlassian.bitbucket.avatar.AbstractAvatarSupplier
com.atlassian.bitbucket.avatar.SimpleAvatarSupplier
- All Implemented Interfaces:
AvatarSupplier
,InputSupplier<InputStream>
A simple implementation of
AvatarSupplier
which accepts the InputStream
containing the avatar's
image data as a constructor parameter.-
Constructor Summary
ConstructorDescriptionSimpleAvatarSupplier
(InputStream inputStream) SimpleAvatarSupplier
(String contentType, InputStream inputStream) Constructs a newSimpleAvatarStream
with the specifiedcontentType
which willreturn
the providedInputStream
. -
Method Summary
Modifier and TypeMethodDescriptionopen()
Retrieves theInputStream
provided when this supplier was constructed.Methods inherited from class com.atlassian.bitbucket.avatar.AbstractAvatarSupplier
getContentType
-
Constructor Details
-
SimpleAvatarSupplier
- Parameters:
inputStream
- the input stream for this supplier- Throws:
NullPointerException
- if the providedinputStream
isnull
-
SimpleAvatarSupplier
Constructs a newSimpleAvatarStream
with the specifiedcontentType
which willreturn
the providedInputStream
.- Parameters:
contentType
- the declared content type for the avatar, which may benull
if not knowninputStream
- the input stream for this supplier- Throws:
NullPointerException
- if the providedinputStream
isnull
-
-
Method Details
-
open
Retrieves theInputStream
provided when this supplier was constructed.- Returns:
- the input stream containing the avatar data
-