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.jlink.jmod - JLink Tool
JDK 17 jdk.jlink.jmod is the JMOD file for JDK 17 JLink tool,
which can be invoked by the "jlink" command.
JDK 17 JLink tool compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.jlink.jmod.
JDK 17 JLink tool compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 JLink tool source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.jlink.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/tools/jlink/internal/plugins/LegalNoticeFilePlugin.java
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package jdk.tools.jlink.internal.plugins;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import jdk.tools.jlink.internal.ModuleSorter;
import jdk.tools.jlink.internal.Utils;
import jdk.tools.jlink.plugin.PluginException;
import jdk.tools.jlink.plugin.ResourcePool;
import jdk.tools.jlink.plugin.ResourcePoolBuilder;
import jdk.tools.jlink.plugin.ResourcePoolEntry;
import jdk.tools.jlink.plugin.ResourcePoolEntry.Type;
import jdk.tools.jlink.plugin.ResourcePoolModule;
/**
* A plugin to de-duplicate the legal notices from JMOD files.
*
* For a de-duplicated legal notice, the actual copy will be in
* the base module and with symbolic links in other modules.
* On platform that does not support symbolic links, a file
* will be created to contain the path to the linked target.
*/
public final class LegalNoticeFilePlugin extends AbstractPlugin {
private static final String ERROR_IF_NOT_SAME_CONTENT = "error-if-not-same-content";
private final Map<String, List<ResourcePoolEntry>> licenseOrNotice =
new HashMap<>();
private boolean errorIfNotSameContent = false;
public LegalNoticeFilePlugin() {
super("dedup-legal-notices");
}
@Override
public Set<State> getState() {
return EnumSet.of(State.AUTO_ENABLED, State.FUNCTIONAL);
}
@Override
public void configure(Map<String, String> config) {
String arg = config.get(getName());
if (arg != null) {
if (arg.equals(ERROR_IF_NOT_SAME_CONTENT)) {
errorIfNotSameContent = true;
} else {
throw new IllegalArgumentException(getName() + ": " + arg);
}
}
}
@Override
public ResourcePool transform(ResourcePool in, ResourcePoolBuilder out) {
// Sort modules in the topological order
// process all legal notices/licenses entries
new ModuleSorter(in.moduleView())
.sorted()
.flatMap(ResourcePoolModule::entries)
.filter(entry -> entry.type() == Type.LEGAL_NOTICE)
.forEach(this::dedupLegalNoticeEntry);
in.entries()
.filter(entry -> entry.type() != Type.LEGAL_NOTICE)
.forEach(out::add);
licenseOrNotice.values().stream()
.flatMap(List::stream)
.forEach(out::add);
return out.build();
}
private void dedupLegalNoticeEntry(ResourcePoolEntry entry) {
Path path = Utils.getJRTFSPath(entry.path());
Path filename = path.getFileName();
List<ResourcePoolEntry> entries =
licenseOrNotice.computeIfAbsent(filename.toString(), _k -> new ArrayList<>());
Optional<ResourcePoolEntry> otarget = entries.stream()
.filter(e -> e.linkedTarget() == null)
.filter(e -> Arrays.equals(e.contentBytes(), entry.contentBytes()))
.findFirst();
if (!otarget.isPresent()) {
if (errorIfNotSameContent) {
// all legal notices of the same file name are expected
// to contain the same content
Optional<ResourcePoolEntry> ores =
entries.stream().filter(e -> e.linkedTarget() == null)
.findAny();
if (ores.isPresent()) {
throw new PluginException(ores.get().path() + " " +
entry.path() + " contain different content");
}
}
entries.add(entry);
} else {
entries.add(ResourcePoolEntry.createSymLink(entry.path(),
entry.type(),
otarget.get()));
}
}
@Override
public Category getType() {
return Category.TRANSFORMER;
}
@Override
public boolean hasArguments() {
return true;
}
}
⏎ jdk/tools/jlink/internal/plugins/LegalNoticeFilePlugin.java
Or download all of them as a single archive file:
File name: jdk.jlink-17.0.5-src.zip File size: 164180 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.jpackage.jmod - JPackage Tool
2023-08-03, ≈20🔥, 0💬
Popular Posts:
Java-WebSocket Source Code Files are provided in the source package file, java-websocket-1.5.4-src .z...
Java Cryptography Extension 1.2.2 JAR File Size and Download Location: File name: jce.jar, jce-1.2.2...
maven-compat-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Compact module. The JAR file name may ...
JDK 11 jdk.jconsole.jmod is the JMOD file for JDK 11 JConsole tool, which can be invoked by the "jco...
How to download and install javamail-1_2.zip? The JavaMail API is a set of abstract APIs that model ...