mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8114830: (fs) Files.copy fails due to interference from something else changing the file system
Reviewed-by: alanb, vtewari
This commit is contained in:
parent
e56d3bc2da
commit
c132176b93
2 changed files with 159 additions and 0 deletions
|
@ -32,6 +32,7 @@ import java.nio.file.DirectoryNotEmptyException;
|
|||
import java.nio.file.FileAlreadyExistsException;
|
||||
import java.nio.file.FileStore;
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.FileSystemException;
|
||||
import java.nio.file.LinkOption;
|
||||
import java.nio.file.LinkPermission;
|
||||
import java.nio.file.Path;
|
||||
|
@ -519,6 +520,8 @@ abstract class UnixFileSystem
|
|||
try {
|
||||
mkdir(target, attrs.mode());
|
||||
} catch (UnixException x) {
|
||||
if (x.errno() == EEXIST && flags.replaceExisting)
|
||||
throw new FileSystemException(target.toString());
|
||||
x.rethrowAsIOException(target);
|
||||
}
|
||||
|
||||
|
@ -665,6 +668,8 @@ abstract class UnixFileSystem
|
|||
O_EXCL),
|
||||
attrs.mode());
|
||||
} catch (UnixException x) {
|
||||
if (x.errno() == EEXIST && flags.replaceExisting)
|
||||
throw new FileSystemException(target.toString());
|
||||
x.rethrowAsIOException(target);
|
||||
}
|
||||
|
||||
|
@ -783,6 +788,8 @@ abstract class UnixFileSystem
|
|||
}
|
||||
}
|
||||
} catch (UnixException x) {
|
||||
if (x.errno() == EEXIST && flags.replaceExisting)
|
||||
throw new FileSystemException(target.toString());
|
||||
x.rethrowAsIOException(target);
|
||||
}
|
||||
}
|
||||
|
@ -797,6 +804,8 @@ abstract class UnixFileSystem
|
|||
try {
|
||||
mknod(target, attrs.mode(), attrs.rdev());
|
||||
} catch (UnixException x) {
|
||||
if (x.errno() == EEXIST && flags.replaceExisting)
|
||||
throw new FileSystemException(target.toString());
|
||||
x.rethrowAsIOException(target);
|
||||
}
|
||||
boolean done = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue