commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Kewley (JIRA)" <>
Subject [jira] [Created] (IO-575) copyDirectory (all overloads) does not maintain file permissions
Date Sun, 18 Mar 2018 12:34:00 GMT
Adam Kewley created IO-575:

             Summary: copyDirectory (all overloads) does not maintain file permissions
                 Key: IO-575
             Project: Commons IO
          Issue Type: Bug
    Affects Versions: 2.5
            Reporter: Adam Kewley

I found that permissions (specifically, execute) are not maintained when using copyDirectory.
The following test demonstrates the behavior:**

Path sourceDir = Files.createTempDirectory("source-dir");
String filename = "some-file";
Path sourceFile = Files.createFile(sourceDir.resolve(filename));




Path destDir = Files.createTempDirectory("some-empty-destination");

FileUtils.copyDirectory(sourceDir.toFile(), destDir.toFile());

Path destFile = destDir.resolve(filename);

assertThat(destFile.toFile().canExecute()).isTrue(); // fails
Is it working as intended that the permissions are not copied over?




This message was sent by Atlassian JIRA

View raw message