Search in sources :

Example 1 with DefaultFileOperations

use of org.graalvm.component.installer.os.DefaultFileOperations in project graal by oracle.

the class InstallerTest method setUp.

@Before
public void setUp() throws IOException {
    targetPath = folder.newFolder("inst").toPath();
    storage = new MockStorage();
    registry = new ComponentRegistry(this, storage);
    fileOps = SystemUtils.isWindows() ? new WindowsFileOperations() : new DefaultFileOperations();
    fileOps.init(this);
    fileOps.setRootPath(targetPath);
}
Also used : DefaultFileOperations(org.graalvm.component.installer.os.DefaultFileOperations) ComponentRegistry(org.graalvm.component.installer.model.ComponentRegistry) WindowsFileOperations(org.graalvm.component.installer.os.WindowsFileOperations) Before(org.junit.Before)

Example 2 with DefaultFileOperations

use of org.graalvm.component.installer.os.DefaultFileOperations in project graal by oracle.

the class FileOperations method createPlatformInstance.

public static FileOperations createPlatformInstance(Feedback f, Path rootPath) {
    FileOperations inst;
    if (SystemUtils.isWindows()) {
        WindowsFileOperations w = new WindowsFileOperations();
        inst = w;
        if (!ImageInfo.inImageCode()) {
            w.setDelayDeletedList(SystemUtils.fromUserString(System.getenv(CommonConstants.ENV_DELETE_LIST)));
            w.setCopyContents(SystemUtils.fromUserString(System.getenv(CommonConstants.ENV_COPY_CONTENTS)));
        }
    } else {
        inst = new DefaultFileOperations();
    }
    inst.init(f);
    inst.setRootPath(rootPath);
    return inst;
}
Also used : DefaultFileOperations(org.graalvm.component.installer.os.DefaultFileOperations) DefaultFileOperations(org.graalvm.component.installer.os.DefaultFileOperations) WindowsFileOperations(org.graalvm.component.installer.os.WindowsFileOperations) WindowsFileOperations(org.graalvm.component.installer.os.WindowsFileOperations)

Aggregations

DefaultFileOperations (org.graalvm.component.installer.os.DefaultFileOperations)2 WindowsFileOperations (org.graalvm.component.installer.os.WindowsFileOperations)2 ComponentRegistry (org.graalvm.component.installer.model.ComponentRegistry)1 Before (org.junit.Before)1