Skip to content

Commit 4d81c42

Browse files
committed
[IO-751] When deleting symlinks, File/PathUtils.deleteDirectory()
changes file permissions of the target. Better assertion message. Builds OK on Windows and macOS, one test fails on Ubuntu.
1 parent 62925e3 commit 4d81c42

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/test/java/org/apache/commons/io/DeleteDirectoryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ public void testDeleteFileCheckParentAccess() throws IOException {
100100
// A file is RO in POSIX if the parent is not W & E.
101101
PathUtils.setReadOnly(file, true);
102102
final Set<PosixFilePermission> permissions = Files.getPosixFilePermissions(testDir);
103-
assertFalse(Files.isWritable(testDir));
104-
assertFalse(Files.isExecutable(testDir));
103+
assertFalse(Files.isWritable(testDir), () -> String.format("Directory '%s' should be Writable, permissions are %s ", testDir, permissions));
104+
assertFalse(Files.isExecutable(testDir), () -> String.format("Directory '%s' should be Executable, permissions are %s ", testDir, permissions));
105105

106106
assertThrows(IOException.class, () -> PathUtils.delete(file));
107107
// Nothing happened, we're not even allowed to test attributes, so the file seems deleted, but it is not.

0 commit comments

Comments
 (0)