When I use FileUtils.copyDirectory()
, the execute bits get turned off for executable files.
Do I have to turn them on manually?
FWIW, my umask is set to 0027 but it looks like FileUtils.copyDirectory()
is not using that setting since the 'other' permissions, aside from the execute bit, are preserved.
The upcoming Filesystem additions in Java 7 will help. Look at JSR-203. If you are using Linux, you can use the backport with Java 6.
The new API that you want is: Files.copy(Path, Path, CopyOptions)
. Note that CopyOptions
has COPY_ATTRIBUTES
, which will do what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With