8293121: (fs) Refactor UnixFileSystem copying into generic Unix, Linux, and BSD implementations

Reviewed-by: alanb
This commit is contained in:
Brian Burkhalter 2022-09-01 22:21:21 +00:00
parent 032be168b5
commit 0a4d0cee9f
11 changed files with 1051 additions and 854 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,10 +25,14 @@
package sun.nio.fs;
import java.nio.file.*;
import java.io.IOException;
import java.util.*;
import java.nio.file.FileStore;
import java.nio.file.WatchService;
import java.security.AccessController;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import sun.security.action.GetPropertyAction;
/**
@ -104,4 +108,19 @@ class BsdFileSystem extends UnixFileSystem {
FileStore getFileStore(UnixMountEntry entry) throws IOException {
return new BsdFileStore(this, entry);
}
// --- file copying ---
@Override
int directCopy(int dst, int src, long addressToPollForCancel)
throws UnixException
{
return directCopy0(dst, src, addressToPollForCancel);
}
// -- native methods --
private static native int directCopy0(int dst, int src,
long addressToPollForCancel)
throws UnixException;
}