Is it possible to copy directory contents using the Java I/O and File-related APIs while preserving existing symlinks? I am working on a tool that needs to perform "directory copy" operations on a variety of UNIX flavours while preserving existing symlinks.
I'd prefer to attempt this using the core Java SE libraries without resorting Runtime.exec/ProcessBuilder to invoke the platform's "/bin/cp" binary. Apache Commons' IOUtils doesn't appear to support this either.
My last resort will be to use Runtime.exec/ProcessBuilder!
UPDATE: I guess I'll be using Runtime.exec/ProcessBuilder to call out to the native "cp" executable since this doesn't seem to be possible using the core Java APIs nor any of the Apache Commons libraries.