All Downloads are FREE. Search and download functionalities are using the official Maven repository.

coursier.credentials.Credentials.scala Maven / Gradle / Ivy

There is a newer version: 2.1.18
Show newest version
package coursier.credentials

import java.io.File

abstract class Credentials extends Serializable {
  // calling this may incur I/O
  def get(): Seq[DirectCredentials]
}

object Credentials {

  def apply(): DirectCredentials = DirectCredentials()
  def apply(host: String, username: String, password: String): DirectCredentials =
    DirectCredentials(host, username, password)
  def apply(
    host: String,
    username: String,
    password: String,
    realm: Option[String]
  ): DirectCredentials = DirectCredentials(host, username, password, realm)
  def apply(host: String, username: String, password: String, realm: String): DirectCredentials =
    DirectCredentials(host, username, password, Option(realm))
  def apply(
    host: String,
    username: String,
    password: String,
    realm: Option[String],
    optional: Boolean
  ): DirectCredentials =
    DirectCredentials(host, Some(username), Some(Password(password)), realm, optional)
  def apply(
    host: String,
    username: String,
    password: String,
    realm: String,
    optional: Boolean
  ): DirectCredentials =
    DirectCredentials(host, Some(username), Some(Password(password)), Option(realm), optional)

  def apply(f: File): FileCredentials =
    FileCredentials(f.getAbsolutePath)
  def apply(f: File, optional: Boolean): FileCredentials =
    FileCredentials(f.getAbsolutePath, optional)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy