Path: blob/master/src/java.base/share/classes/sun/security/provider/certpath/SunCertPathBuilderException.java
41161 views
/*1* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.security.provider.certpath;2627import java.util.List;28import java.security.cert.CertPathBuilderException;2930/**31* This is a subclass of the generic <code>CertPathBuilderException</code>.32* It contains an adjacency list with information regarding the unsuccessful33* paths that the SunCertPathBuilder tried.34*35* @since 1.436* @author Sean Mullan37* @see CertPathBuilderException38*/39public class SunCertPathBuilderException extends CertPathBuilderException {4041@java.io.Serial42private static final long serialVersionUID = -7814288414129264709L;4344/**45* @serial46*/47private transient AdjacencyList adjList;4849/**50* Constructs a <code>SunCertPathBuilderException</code> with51* <code>null</code> as its detail message.52*/53public SunCertPathBuilderException() {54super();55}5657/**58* Constructs a <code>SunCertPathBuilderException</code> with the specified59* detail message. A detail message is a <code>String</code> that60* describes this particular exception.61*62* @param msg the detail message63*/64public SunCertPathBuilderException(String msg) {65super(msg);66}6768/**69* Constructs a <code>SunCertPathBuilderException</code> that wraps the70* specified throwable. This allows any exception to be converted into a71* <code>SunCertPathBuilderException</code>, while retaining information72* about the cause, which may be useful for debugging. The detail message is73* set to (<code>cause==null ? null : cause.toString()</code>) (which74* typically contains the class and detail message of cause).75*76* @param cause the cause (which is saved for later retrieval by the77* {@link #getCause getCause()} method). (A <code>null</code> value is78* permitted, and indicates that the cause is nonexistent or unknown.)79* root cause.80*/81public SunCertPathBuilderException(Throwable cause) {82super(cause);83}8485/**86* Creates a <code>SunCertPathBuilderException</code> with the specified87* detail message and cause.88*89* @param msg the detail message90* @param cause the cause91*/92public SunCertPathBuilderException(String msg, Throwable cause) {93super(msg, cause);94}9596/**97* Creates a <code>SunCertPathBuilderException</code> with the specified98* detail message and adjacency list.99*100* @param msg the detail message101* @param adjList the adjacency list102*/103SunCertPathBuilderException(String msg, AdjacencyList adjList) {104this(msg);105this.adjList = adjList;106}107108/**109* Creates a <code>SunCertPathBuilderException</code> with the specified110* detail message, cause, and adjacency list.111*112* @param msg the detail message113* @param cause the throwable that occurred114* @param adjList Adjacency list115*/116SunCertPathBuilderException(String msg, Throwable cause,117AdjacencyList adjList)118{119this(msg, cause);120this.adjList = adjList;121}122123/**124* Returns the adjacency list containing information about the build.125*126* @return the adjacency list containing information about the build127*/128public AdjacencyList getAdjacencyList() {129return adjList;130}131}132133134