Search in sources :

Example 1 with DirectoryStorage

use of org.graalvm.component.installer.persist.DirectoryStorage in project graal by oracle.

the class ComponentInstaller method completeEnvironment.

protected Environment completeEnvironment() {
    if (env.getGraalHomePath() != null) {
        return env;
    }
    findGraalHome();
    env.setGraalHome(graalHomePath);
    // Use our own GraalVM's trust store contents; also bypasses embedded trust store
    // when running AOT.
    Path trustStorePath = SystemUtils.resolveRelative(SystemUtils.getRuntimeBaseDir(env.getGraalHomePath()), // NOI18N
    "lib/security/cacerts");
    // NOI18N
    System.setProperty("javax.net.ssl.trustStore", trustStorePath.normalize().toString());
    DirectoryStorage storage = new DirectoryStorage(env, storagePath, graalHomePath);
    storage.setConfig(env);
    storage.setJavaVersion("" + SystemUtils.getJavaMajorVersion(env));
    env.setLocalRegistry(new ComponentRegistry(env, storage));
    FileOperations fops = FileOperations.createPlatformInstance(env, env.getGraalHomePath());
    env.setFileOperations(fops);
    // also sets up input and feedback.
    forSoftwareChannels(true, (ch) -> {
        ch.init(input, feedback);
    });
    return env;
}
Also used : Path(java.nio.file.Path) DirectoryStorage(org.graalvm.component.installer.persist.DirectoryStorage) ComponentRegistry(org.graalvm.component.installer.model.ComponentRegistry)

Example 2 with DirectoryStorage

use of org.graalvm.component.installer.persist.DirectoryStorage in project graal by oracle.

the class UpgradeProcess method createRegistryFor.

private ComponentRegistry createRegistryFor(Path home) {
    DirectoryStorage dst = new DirectoryStorage(feedback.withBundle(ComponentInstaller.class), home.resolve(SystemUtils.fromCommonRelative(CommonConstants.PATH_COMPONENT_STORAGE)), home);
    dst.setJavaVersion(input.getLocalRegistry().getJavaVersion());
    return new ComponentRegistry(feedback, dst);
}
Also used : DirectoryStorage(org.graalvm.component.installer.persist.DirectoryStorage) ComponentRegistry(org.graalvm.component.installer.model.ComponentRegistry) ComponentInstaller(org.graalvm.component.installer.ComponentInstaller)

Aggregations

ComponentRegistry (org.graalvm.component.installer.model.ComponentRegistry)2 DirectoryStorage (org.graalvm.component.installer.persist.DirectoryStorage)2 Path (java.nio.file.Path)1 ComponentInstaller (org.graalvm.component.installer.ComponentInstaller)1