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

de.svws_nrw.davapi.api.DavExtendedHttpStatus Maven / Gradle / Ivy

Go to download

Diese Bibliothek enthält die Java-Server-Definition der CalDAV und CardDAV-Schnittstelle für die Schulverwaltungssoftware in NRW

There is a newer version: 1.0.1
Show newest version
package de.svws_nrw.davapi.api;

import jakarta.ws.rs.core.Response;

/**
 * Erweiterung der StatusType-Enumeration um die DAV-spezifischen
 * HTTP-Status-Codes.
 */
public enum DavExtendedHttpStatus implements Response.StatusType {

	/** Konstante für den HTTPStatus 207 MULTISTATUS */
	MULTISTATUS(207, "Multi-Status");

	/** HTTP-Response-Code */
	private final int code;
	/** Beschreibung des HTTP-Response-Codes */
	private final String reason;
	/** Status-Familie des HTTP-Response-Codes */
	private final Response.Status.Family family;

	/**
	 * Erstellt einen neuen DavExtendedHttpStatus
	 *
	 * @param statusCode   HTTP-Status-Code
	 * @param reasonPhrase Beschreibung des HTTP-Response-Codes
	 */
	DavExtendedHttpStatus(final int statusCode, final String reasonPhrase) {
		this.code = statusCode;
		this.reason = reasonPhrase;
		this.family = Response.Status.Family.familyOf(statusCode);
	}

	@Override
	public int getStatusCode() {
		return code;
	}

	@Override
	public Response.Status.Family getFamily() {
		return family;
	}

	@Override
	public String getReasonPhrase() {
		return reason;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy