Class Oauth2LoginStreamingOutput

java.lang.Object
org.gitlab4j.api.utils.Oauth2LoginStreamingOutput
All Implemented Interfaces:
AutoCloseable, javax.ws.rs.core.StreamingOutput

public class Oauth2LoginStreamingOutput extends Object implements javax.ws.rs.core.StreamingOutput, AutoCloseable
This StreamingOutput implementation is utilized to send a OAuth2 token request in a secure manner. The password is never copied to a String, instead it is contained in a SecretString that is cleared when an instance of this class is finalized.
  • Constructor Details

    • Oauth2LoginStreamingOutput

      public Oauth2LoginStreamingOutput(String username, CharSequence password)
    • Oauth2LoginStreamingOutput

      public Oauth2LoginStreamingOutput(String username, char[] password)
  • Method Details

    • write

      public void write(OutputStream output) throws IOException, javax.ws.rs.WebApplicationException
      Specified by:
      write in interface javax.ws.rs.core.StreamingOutput
      Throws:
      IOException
      javax.ws.rs.WebApplicationException
    • clearPassword

      public void clearPassword()
      Clears the contained password's data.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • finalize

      public void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable