Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.base/share/classes/com/sun/security/ntlm/NTLMException.java
41161 views
1
/*
2
* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
package com.sun.security.ntlm;
27
28
import java.security.GeneralSecurityException;
29
30
/**
31
* An NTLM-related Exception
32
*/
33
public final class NTLMException extends GeneralSecurityException {
34
@java.io.Serial
35
private static final long serialVersionUID = -3298539507906689430L;
36
37
/**
38
* If the incoming packet is invalid.
39
*/
40
public static final int PACKET_READ_ERROR = 1;
41
42
/**
43
* If the client cannot get a domain value from the server and the
44
* caller has not provided one.
45
*/
46
public static final int NO_DOMAIN_INFO = 2;
47
48
/**
49
* If the client name is not found on server's user database.
50
*/
51
public static final int USER_UNKNOWN = 3;
52
53
/**
54
* If authentication fails.
55
*/
56
public static final int AUTH_FAILED = 4;
57
58
/**
59
* If an illegal version string is provided.
60
*/
61
public static final int BAD_VERSION = 5;
62
63
/**
64
* Protocol errors.
65
*/
66
public static final int PROTOCOL = 6;
67
68
private int errorCode;
69
70
/**
71
* Constructs an NTLMException object.
72
* @param errorCode the error code, which can be retrieved by
73
* the {@link #errorCode() } method.
74
* @param msg the string message, which can be retrived by
75
* the {@link Exception#getMessage() } method.
76
*/
77
public NTLMException(int errorCode, String msg) {
78
super(msg);
79
this.errorCode = errorCode;
80
}
81
82
/**
83
* Returns the error code associated with this NTLMException.
84
* @return the error code
85
*/
86
public int errorCode() {
87
return errorCode;
88
}
89
}
90
91