Page 1 of 1

About Question enthuware.ocpjp.v7.2.1524 :

Posted: Tue Sep 03, 2013 8:45 am
by The_Nick
Hi everybody,
I see that in Files.move the NOFOLLOW_LINKS option is implicit. There is no need to specify it when moving a link right?

The_Nick

Re: About Question enthuware.ocpjp.v7.2.1524 :

Posted: Wed Jan 29, 2014 4:27 pm
by EpicWestern
The explanation has Files.move(p1,p2) being wrong because it will throw a java.noi.file.FileAlreadyExistsException

However Files.move(p1,p2) is not a valid method.

Re: About Question enthuware.ocpjp.v7.2.1524 :

Posted: Wed Jan 29, 2014 10:28 pm
by admin
There is : http://docs.oracle.com/javase/7/docs/ap ... .html#move(java.nio.file.Path, java.nio.file.Path, java.nio.file.CopyOption...)

The last argument can be omitted so the given option and the explanation are valid.

Re: About Question enthuware.ocpjp.v7.2.1524 :

Posted: Thu Jan 12, 2023 4:48 am
by k.vaidas@gmail.com
Also options with try-with-resources are incorrect not only because Path doesn't implement AutoCloseable. Even if it did, syntax is incorrect, you would get "Declaration, final or effectively final variable expected", because variable is neccessary.