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 11 jdk.jlink.jmod - JLink Tool
JDK 11 jdk.jlink.jmod is the JMOD file for JDK 11 JLink tool,
which can be invoked by the "jlink" command.
JDK 11 JLink tool compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.jlink.jmod.
JDK 11 JLink tool compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 JLink tool source code files are stored in \fyicenter\jdk-11.0.1\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.Plugin;
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 implements Plugin {
private static final String NAME = "dedup-legal-notices";
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;
@Override
public String getName() {
return NAME;
}
@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(NAME);
if (arg != null) {
if (arg.equals(ERROR_IF_NOT_SAME_CONTENT)) {
errorIfNotSameContent = true;
} else {
throw new IllegalArgumentException(NAME + ": " + 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 String getDescription() {
return PluginsResourceBundle.getDescription(NAME);
}
@Override
public boolean hasArguments() {
return true;
}
@Override
public String getArgumentsDescription() {
return PluginsResourceBundle.getArgument(NAME);
}
}
⏎ jdk/tools/jlink/internal/plugins/LegalNoticeFilePlugin.java
Or download all of them as a single archive file:
File name: jdk.jlink-11.0.1-src.zip File size: 155677 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.jshell.jmod - JShell Tool
2020-06-30, ≈54🔥, 0💬
Popular Posts:
maven-compat-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Compact module. The JAR file name may ...
JDK 8 tools.jar is the JAR file for JDK 8 tools. It contains Java classes to support different JDK t...
JDK 11 java.xml.crypto.jmod is the JMOD file for JDK 11 XML (eXtensible Markup Language) Crypto modu...
JDK 17 java.base.jmod is the JMOD file for JDK 17 Base module. JDK 17 Base module compiled class fil...
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java"....