Modifier and Type | Method and Description |
---|---|
static void |
copyRecursive(Path source,
Path target,
CopyOption... copyOptions)
Copy a directory to a target directory recursively.
|
public static void copyRecursive(Path source, Path target, CopyOption... copyOptions) throws IOException
This method performs a copy much like
Files.copy(Path, Path, CopyOption...)
. Unlike
Files.copy(Path, Path, CopyOption...)
is can also copy non-empty
directories.
This method makes a best effort to copy attributes across different file system providers.
source
- the path to the file to copytarget
- the path to the target file (may be associated with a different
provider to the source path)copyOptions
- options specifying how the copy should be doneIOException
- if an I/O error occursFiles.copy(Path, Path, CopyOption...)
Copyright © 2011–2018. All rights reserved.