Is it possible to copy the contents of a directory using the Java I / O APIs and files while preserving existing symbolic links? I am working on a tool that must perform directory copy operations on various UNIX variants while maintaining existing symbolic links.
I would prefer to try this using the core Java SE libraries without resorting to Runtime.exec / ProcessBuilder to invoke the platform binary / bin / cp. IOUtils Apache Commons may not support this.
Recently, I will use Runtime.exec / ProcessBuilder!
UPDATE: I assume that I will use Runtime.exec / ProcessBuilder to call my own cp executable, as this is not possible using the core Java APIs or any of the Apache Commons libraries.
source
share