Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
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 (322)
Collections:
Other Resources:
JDK 17 jdk.naming.dns.jmod - Naming DNS Module
JDK 17 jdk.naming.dns.jmod is the JMOD file for JDK 17 Naming DNS module.
JDK 17 Naming DNS module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.naming.dns.jmod.
JDK 17 Naming DNS module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Naming DNS module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.naming.dns.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/jndi/dns/DnsUrl.java
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.jndi.dns;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Locale;
import java.util.StringTokenizer;
import com.sun.jndi.toolkit.url.Uri;
import com.sun.jndi.toolkit.url.UrlUtil;
/**
* A DnsUrl represents a DNS pseudo-URL of the form
* <pre>
* dns://[host][:port][/[domain]]
* or
* dns:[/][domain]
* </pre>
* The host names a DNS server. If the host is not provided, it
* indicates that the underlying platform's DNS server(s) should be
* used if possible, or that "localhost" should be used otherwise. If
* the port is not provided, the DNS default port 53 will be used.
* The domain indicates the domain name of the context, and is not
* necessarily related to the domain of the server; if it is not
* provided, the root domain "." is used. Special characters in
* the domain name must be %-escaped as described in RFC 2396.
*
* @author Scott Seligman
*/
public class DnsUrl extends Uri {
private static final String PARSE_MODE_PROP = "com.sun.jndi.dnsURLParsing";
private static final ParseMode DEFAULT_PARSE_MODE = ParseMode.COMPAT;
public static final ParseMode PARSE_MODE;
static {
PrivilegedAction<String> action = () ->
System.getProperty(PARSE_MODE_PROP, DEFAULT_PARSE_MODE.toString());
ParseMode parseMode = DEFAULT_PARSE_MODE;
try {
@SuppressWarnings("removal")
String mode = AccessController.doPrivileged(action);
parseMode = ParseMode.valueOf(mode.toUpperCase(Locale.ROOT));
} catch (Throwable t) {
parseMode = DEFAULT_PARSE_MODE;
} finally {
PARSE_MODE = parseMode;
}
}
private String domain; // domain name of the context
/**
* Given a space-separated list of DNS URLs, returns an array of DnsUrl
* objects.
*/
public static DnsUrl[] fromList(String urlList)
throws MalformedURLException {
DnsUrl[] urls = new DnsUrl[(urlList.length() + 1) / 2];
int i = 0; // next available index in urls
StringTokenizer st = new StringTokenizer(urlList, " ");
while (st.hasMoreTokens()) {
try {
urls[i++] = new DnsUrl(validateURI(st.nextToken()));
} catch (URISyntaxException e) {
MalformedURLException mue = new MalformedURLException(e.getMessage());
mue.initCause(e);
throw mue;
}
}
DnsUrl[] trimmed = new DnsUrl[i];
System.arraycopy(urls, 0, trimmed, 0, i);
return trimmed;
}
@Override
protected ParseMode parseMode() {
return PARSE_MODE;
}
@Override
protected final boolean isSchemeOnly(String uri) {
return isDnsSchemeOnly(uri);
}
@Override
protected boolean checkSchemeOnly(String uri, String scheme) {
return uri.equals(scheme + ":") || uri.equals(scheme + "://");
}
@Override
protected final MalformedURLException newInvalidURISchemeException(String uri) {
return new MalformedURLException(
uri + " is not a valid DNS pseudo-URL");
}
private static boolean isDnsSchemeOnly(String uri) {
return "dns:".equals(uri) || "dns://".equals(uri);
}
private static String validateURI(String uri) throws URISyntaxException {
// no validation in legacy parsing mode
if (PARSE_MODE == ParseMode.LEGACY) return uri;
// special case of scheme-only URIs
if (isDnsSchemeOnly(uri)) return uri;
// use java.net.URI to validate the uri syntax
return new URI(uri).toString();
}
public DnsUrl(String url) throws MalformedURLException {
super(url);
if (!scheme.equals("dns")) {
throw newInvalidURISchemeException(url);
}
domain = path.startsWith("/")
? path.substring(1)
: path;
domain = domain.isEmpty()
? "."
: UrlUtil.decode(domain);
// Debug
// System.out.println("host=" + host + " port=" + port +
// " domain=" + domain);
}
/**
* Returns the domain of this URL, or "." if none is provided.
* Never null.
*/
public String getDomain() {
return domain;
}
/*
// Debug
public static void main(String args[]) throws MalformedURLException {
DnsUrl[] urls = fromList(args[0]);
for (int i = 0; i < urls.length; i++) {
System.out.println(urls[i].toString());
}
}
*/
}
⏎ com/sun/jndi/dns/DnsUrl.java
Or download all of them as a single archive file:
File name: jdk.naming.dns-17.0.5-src.zip File size: 48006 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.naming.rmi.jmod - Naming RMI Module
2023-07-29, ∼5248🔥, 0💬
Popular Posts:
Java Servlet API 3.0.1 Source Code Files are important if you want to compile them with different JD...
How to show the XML parsing flow with sax\DocumentTracer.java provided in the Apache Xerces package?...
Where Can I get source code files of jsse.jar? You can get source code files of jsse.jar (JSSE) from...
JDK 11 jdk.aot.jmod is the JMOD file for JDK 11 Ahead-of-Time (AOT) Compiler module. JDK 11 AOT Comp...
JDK 11 jrt-fs.jar is the JAR file for JDK 11 JRT-FS (Java RunTime - File System) defined in the "jdk...