Oracle tutorial about Files.copy(Path1, Path2, StandardCopyOption.REPLACE_EXISTING);

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
The_Nick
Posts: 132
Joined: Thu May 16, 2013 9:23 am
Contact:

Oracle tutorial about Files.copy(Path1, Path2, StandardCopyOption.REPLACE_EXISTING);

Post by The_Nick »

Hi there,
Giving credit to the official java oracle tutorial: http://docs.oracle.com/javase/tutorial/ ... /copy.html
REPLACE_EXISTING – Performs the copy even when the target file already exists. If the target is a symbolic link, the link itself is copied (and not the target of the link). If the target is a non-empty directory, the copy fails with the FileAlreadyExistsException exception.
(Emphasis mine)

Ok I have tried it out and it actually gives back a DirectoryNotEmptyException. Do you confirm the oracle java tutorial glitch or it's just me misinterpretring the concept?

Thanks in advance.

The_Nick.

Online
admin
Site Admin
Posts: 10067
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: Oracle tutorial about Files.copy(Path1, Path2, StandardCopyOption.REPLACE_EXISTING);

Post by admin »

Seems like the tutorial has an error.

-Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 239 guests