Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 11 java.base.jmod - Base Module
JDK 11 java.base.jmod is the JMOD file for JDK 11 Base module.
JDK 11 Base module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.base.jmod.
JDK 11 Base module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Base module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.base.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ sun/net/www/protocol/http/ntlm/NTLMAuthentication.java
/* * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package sun.net.www.protocol.http.ntlm; import java.io.IOException; import java.net.InetAddress; import java.net.PasswordAuthentication; import java.net.UnknownHostException; import java.net.URL; import java.util.Objects; import java.util.Properties; import sun.net.www.HeaderParser; import sun.net.www.protocol.http.AuthenticationInfo; import sun.net.www.protocol.http.AuthScheme; import sun.net.www.protocol.http.HttpURLConnection; import sun.security.action.GetPropertyAction; /** * NTLMAuthentication: * * @author Michael McMahon */ public class NTLMAuthentication extends AuthenticationInfo { private static final long serialVersionUID = 100L; private static final NTLMAuthenticationCallback NTLMAuthCallback = NTLMAuthenticationCallback.getNTLMAuthenticationCallback(); private String hostname; /* Domain to use if not specified by user */ private static final String defaultDomain; /* Whether cache is enabled for NTLM */ private static final boolean ntlmCache; static { Properties props = GetPropertyAction.privilegedGetProperties(); defaultDomain = props.getProperty("http.auth.ntlm.domain", "domain"); String ntlmCacheProp = props.getProperty("jdk.ntlm.cache", "true"); ntlmCache = Boolean.parseBoolean(ntlmCacheProp); } private void init0() { hostname = java.security.AccessController.doPrivileged( new java.security.PrivilegedAction<String>() { public String run() { String localhost; try { localhost = InetAddress.getLocalHost().getHostName().toUpperCase(); } catch (UnknownHostException e) { localhost = "localhost"; } return localhost; } }); int x = hostname.indexOf ('.'); if (x != -1) { hostname = hostname.substring (0, x); } } String username; String ntdomain; String password; /** * Create a NTLMAuthentication: * Username may be specified as {@literal domain<BACKSLASH>username} * in the application Authenticator. * If this notation is not used, then the domain will be taken * from a system property: "http.auth.ntlm.domain". */ public NTLMAuthentication(boolean isProxy, URL url, PasswordAuthentication pw, String authenticatorKey) { super(isProxy ? PROXY_AUTHENTICATION : SERVER_AUTHENTICATION, AuthScheme.NTLM, url, "", Objects.requireNonNull(authenticatorKey)); init (pw); } private void init (PasswordAuthentication pw) { this.pw = pw; if (pw != null) { String s = pw.getUserName(); int i = s.indexOf ('\\'); if (i == -1) { username = s; ntdomain = defaultDomain; } else { ntdomain = s.substring (0, i).toUpperCase(); username = s.substring (i+1); } password = new String (pw.getPassword()); } else { /* credentials will be acquired from OS */ username = null; ntdomain = null; password = null; } init0(); } /** * Constructor used for proxy entries */ public NTLMAuthentication(boolean isProxy, String host, int port, PasswordAuthentication pw, String authenticatorKey) { super(isProxy?PROXY_AUTHENTICATION:SERVER_AUTHENTICATION, AuthScheme.NTLM, host, port, "", Objects.requireNonNull(authenticatorKey)); init (pw); } @Override protected boolean useAuthCache() { return ntlmCache && super.useAuthCache(); } /** * @return true if this authentication supports preemptive authorization */ @Override public boolean supportsPreemptiveAuthorization() { return false; } /** * @return true if NTLM supported transparently (no password needed, SSO) */ public static boolean supportsTransparentAuth() { return true; } /** * Returns true if the given site is trusted, i.e. we can try * transparent Authentication. */ public static boolean isTrustedSite(URL url) { return NTLMAuthCallback.isTrustedSite(url); } /** * Not supported. Must use the setHeaders() method */ @Override public String getHeaderValue(URL url, String method) { throw new RuntimeException ("getHeaderValue not supported"); } /** * Check if the header indicates that the current auth. parameters are stale. * If so, then replace the relevant field with the new value * and return true. Otherwise return false. * returning true means the request can be retried with the same userid/password * returning false means we have to go back to the user to ask for a new * username password. */ @Override public boolean isAuthorizationStale (String header) { return false; /* should not be called for ntlm */ } /** * Set header(s) on the given connection. * @param conn The connection to apply the header(s) to * @param p A source of header values for this connection, not used because * HeaderParser converts the fields to lower case, use raw instead * @param raw The raw header field. * @return true if all goes well, false if no headers were set. */ @Override public synchronized boolean setHeaders(HttpURLConnection conn, HeaderParser p, String raw) { try { NTLMAuthSequence seq = (NTLMAuthSequence)conn.authObj(); if (seq == null) { seq = new NTLMAuthSequence (username, password, ntdomain); conn.authObj(seq); } String response = "NTLM " + seq.getAuthHeader (raw.length()>6?raw.substring(5):null); conn.setAuthenticationProperty(getHeaderName(), response); if (seq.isComplete()) { conn.authObj(null); } return true; } catch (IOException e) { conn.authObj(null); return false; } } }
⏎ sun/net/www/protocol/http/ntlm/NTLMAuthentication.java
Or download all of them as a single archive file:
File name: java.base-11.0.1-src.zip File size: 8740354 bytes Release date: 2018-11-04 Download
2020-05-29, 207177👍, 0💬
Popular Posts:
Snappy-Java is a Java port of the "snappy", a fast C++ compresser/decompresser developed by Google. ...
JDOM provides a solution for using XML from Java that is as simple as Java itself. There is no compe...
JDK 11 java.management.jmod is the JMOD file for JDK 11 Management module. JDK 11 Management module ...
JDK 11 java.desktop.jmod is the JMOD file for JDK 11 Desktop module. JDK 11 Desktop module compiled ...
What Is fop.jar? I got it from the fop-2.7-bin.zip. fop.jar in fop-2.7-bin.zip is the JAR file for F...