Package uk.ac.starlink.auth

# Class ProtectionSpace

java.lang.Object
uk.ac.starlink.auth.ProtectionSpace

public class ProtectionSpace extends Object
Protection Space is a concept defined in RFC7235, aggregating the canonical root URI and an optional realm. It defines the domain within which the same authentication credentials can be applied.

Since:
  8 Jun 2020
Author:
  Mark Taylor
See Also:
  - RFC 7235, section 2.2

## Constructor Summary

Constructors
Constructor
Description
`ProtectionSpace(String proto, String authority, String realm)`
Constructs a ProtectionSpace using URL parts.
`ProtectionSpace(URL url, String realm)`
Constructs a ProtectionSpace using a URL.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object other)`
`int`
`hashCode()`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### ProtectionSpace

public ProtectionSpace(String proto, String authority, String realm)
Constructs a ProtectionSpace using URL parts.

Parameters:
  `proto` - protocol part of URL, for instance "http"
  `authority` - authority part of URL
  `realm` - challenge realm, or null

### ProtectionSpace

public ProtectionSpace(URL url, String realm)
Constructs a ProtectionSpace using a URL.

Parameters:
  `url` - URL
  `realm` - challenge realm, or null

## Method Details

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object other)

Overrides:
  `equals` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`