I don't like how the code below looks, and I would like to know how to do this using the ternary operator:
if (isIndexed) {
Files.move(source, destination);
}
else {
Files.move(source, destination, StandardCopyOption.REPLACE_EXISTING);
}
I expect something similar:
Files.move(source, destination, isIndexed ? xxxx : StandardCopyOption.REPLACE_EXISTING);
If I could use some kind of "default" option, I would think that this would be what I'm looking for. But the enumeration for StandardCopyOption does not have the "NONE" option.
So I probably missed something. What is it?
source
share