< prev index next >
src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java
Print this page
@@ -56,11 +56,10 @@
import java.util.Properties;
import java.util.Set;
import static java.util.stream.Collectors.*;
import jdk.tools.jlink.internal.BasicImageWriter;
-import jdk.tools.jlink.internal.plugins.FileCopierPlugin.SymImageFile;
import jdk.tools.jlink.internal.ExecutableImage;
import jdk.tools.jlink.plugin.ResourcePool;
import jdk.tools.jlink.plugin.ResourcePoolEntry;
import jdk.tools.jlink.plugin.ResourcePoolEntry.Type;
import jdk.tools.jlink.plugin.ResourcePoolModule;
@@ -147,24 +146,10 @@
this.root = root;
this.mdir = root.resolve("lib");
Files.createDirectories(mdir);
}
- private void storeRelease(ResourcePool pool) throws IOException {
- Properties props = new Properties();
- Optional<ResourcePoolEntry> release = pool.findEntry("/java.base/release");
- if (release.isPresent()) {
- try (InputStream is = release.get().content()) {
- props.load(is);
- }
- }
- File r = new File(root.toFile(), "release");
- try (FileOutputStream fo = new FileOutputStream(r)) {
- props.store(fo, null);
- }
- }
-
@Override
public void storeFiles(ResourcePool files) {
try {
// populate targetOsName field up-front because it's used elsewhere.
Optional<ResourcePoolModule> javaBase = files.moduleView().findModule("java.base");
@@ -178,13 +163,10 @@
if (this.targetOsName == null) {
throw new PluginException("TargetPlatform attribute is missing for java.base module");
}
- // store 'release' file
- storeRelease(files);
-
Path bin = root.resolve(BIN_DIRNAME);
// check any duplicated resource files
Map<Path, Set<String>> duplicates = new HashMap<>();
files.entries()
@@ -371,12 +353,10 @@
return Paths.get(MAN_DIRNAME, entryToFileName(entry));
case LEGAL_NOTICE:
return Paths.get(LEGAL_DIRNAME, entryToFileName(entry));
case TOP:
return Paths.get(entryToFileName(entry));
- case OTHER:
- return Paths.get("other", entryToFileName(entry));
default:
throw new IllegalArgumentException("invalid type: " + entry);
}
}
@@ -410,23 +390,13 @@
Path relPath = source.getParent().relativize(target);
writeSymLinkEntry(root.resolve(source), relPath);
}
break;
case TOP:
- break;
- case OTHER:
- String filename = entryToFileName(file);
- if (file instanceof SymImageFile) {
- SymImageFile sym = (SymImageFile) file;
- Path target = root.resolve(sym.getTargetPath());
- if (!Files.exists(target)) {
- throw new IOException("Sym link target " + target
- + " doesn't exist");
- }
- writeSymEntry(root.resolve(filename), target);
- } else {
- writeEntry(in, root.resolve(filename));
+ // Copy TOP files of the "java.base" module (only)
+ if ("java.base".equals(file.moduleName())) {
+ writeEntry(in, root.resolve(entryToImagePath(file)));
}
break;
default:
throw new InternalError("unexpected entry: " + file.path());
}
< prev index next >