Class SimpleAvatarSupplier

java.lang.Object
com.atlassian.bitbucket.avatar.AbstractAvatarSupplier
com.atlassian.bitbucket.avatar.SimpleAvatarSupplier
All Implemented Interfaces:
AvatarSupplier, InputSupplier<InputStream>

public class SimpleAvatarSupplier extends AbstractAvatarSupplier
A simple implementation of AvatarSupplier which accepts the InputStream containing the avatar's image data as a constructor parameter.
  • Constructor Details

    • SimpleAvatarSupplier

      public SimpleAvatarSupplier(@Nonnull InputStream inputStream)
      Constructs a new SimpleAvatarSupplier which will return the provided InputStream.
      Parameters:
      inputStream - the input stream for this supplier
      Throws:
      NullPointerException - if the provided inputStream is null
    • SimpleAvatarSupplier

      public SimpleAvatarSupplier(String contentType, @Nonnull InputStream inputStream)
      Constructs a new SimpleAvatarStream with the specified contentType which will return the provided InputStream.
      Parameters:
      contentType - the declared content type for the avatar, which may be null if not known
      inputStream - the input stream for this supplier
      Throws:
      NullPointerException - if the provided inputStream is null
  • Method Details

    • open

      @Nonnull public InputStream open()
      Retrieves the InputStream provided when this supplier was constructed.
      Returns:
      the input stream containing the avatar data