Handle InvalidPathException in FS_POSIX#createNewFileAtomic
Bug: 547400 Change-Id: Ic3541e360a2968ba3532a3d3fa4828b0d0463c02 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
cc29da8e0f
commit
6ef225c519
|
@ -50,6 +50,7 @@
|
|||
import java.nio.charset.Charset;
|
||||
import java.nio.file.FileAlreadyExistsException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.InvalidPathException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.attribute.PosixFilePermission;
|
||||
|
@ -448,7 +449,7 @@ public LockToken createNewFileAtomic(File file) throws IOException {
|
|||
try {
|
||||
path = file.toPath();
|
||||
Files.createFile(path);
|
||||
} catch (FileAlreadyExistsException e) {
|
||||
} catch (FileAlreadyExistsException | InvalidPathException e) {
|
||||
return token(false, null);
|
||||
}
|
||||
if (supportsAtomicCreateNewFile() || !supportsUnixNLink) {
|
||||
|
|
Loading…
Reference in New Issue