You can create a FileOutputStream for the target file using File::createOutputStream(), and write the data using FileOutputStream::write(). This will preserve the metadata, but is quite a bit more annoying and error-prone than using methods like replaceWithText().
You’re correct about the logic in File::setCreationTime(). It looks like this isn’t an issue on Windows, as its setFileTimesInternal() implementation doesn’t perform the (modificationTime != 0 || accessTime != 0) check. But for other systems that use the POSIX implementation, setCreationTime() will always fail due to this check.