| @@ -70,6 +70,11 @@ Other changes: | |||||
| can be used to specify the file's encoding. | can be used to specify the file's encoding. | ||||
| Bugzilla Report 62379 | Bugzilla Report 62379 | ||||
| * New file selectors, posixGroup and posixPermissions, are available. | |||||
| The new selectors and related ownedBy selector have "followSymlinks" | |||||
| attribute that defaults to "true" for consistency. | |||||
| Bugzilla Report 22370 | |||||
| Changes from Ant 1.10.2 TO Ant 1.10.3 | Changes from Ant 1.10.2 TO Ant 1.10.3 | ||||
| ===================================== | ===================================== | ||||
| @@ -928,7 +928,7 @@ | |||||
| <tr> | <tr> | ||||
| <td>followsymlinks</td> | <td>followsymlinks</td> | ||||
| <td>Must the selector follow symbolic links?</td> | <td>Must the selector follow symbolic links?</td> | ||||
| <td>No; defaults to <q>false</q> (was <q>true</q> before Ant 1.10.4)</td> | |||||
| <td>No; defaults to <q>true</q></td> | |||||
| </tr> | </tr> | ||||
| </table> | </table> | ||||
| @@ -955,7 +955,7 @@ | |||||
| <tr> | <tr> | ||||
| <td>followsymlinks</td> | <td>followsymlinks</td> | ||||
| <td>Must the selector follow symbolic links?</td> | <td>Must the selector follow symbolic links?</td> | ||||
| <td>No; defaults to <q>false</q></td> | |||||
| <td>No; defaults to <q>true</q></td> | |||||
| </tr> | </tr> | ||||
| </table> | </table> | ||||
| @@ -982,7 +982,7 @@ | |||||
| <tr> | <tr> | ||||
| <td>followsymlinks</td> | <td>followsymlinks</td> | ||||
| <td>Must the selector follow symbolic links?</td> | <td>Must the selector follow symbolic links?</td> | ||||
| <td>No; defaults to <q>false</q></td> | |||||
| <td>No; defaults to <q>true</q></td> | |||||
| </tr> | </tr> | ||||
| </table> | </table> | ||||
| @@ -42,7 +42,7 @@ public class OwnedBySelector implements FileSelector { | |||||
| private String owner; | private String owner; | ||||
| private boolean followSymlinks = false; | |||||
| private boolean followSymlinks = true; | |||||
| /** | /** | ||||
| * Sets the user name to look for. | * Sets the user name to look for. | ||||
| @@ -53,11 +53,11 @@ public class OwnedBySelector implements FileSelector { | |||||
| } | } | ||||
| /** | /** | ||||
| * Sets the "follow links" flag. | |||||
| * @param followSymlinks the user name | |||||
| * Sets the "follow symbolic links" option. | |||||
| * @param followSymlinks whether or not symbolic links should be followed. | |||||
| */ | */ | ||||
| public void setFollowSymlinks(String followSymlinks) { | |||||
| this.followSymlinks = PropertyHelper.toBoolean(followSymlinks); | |||||
| public void setFollowSymlinks(boolean followSymlinks) { | |||||
| this.followSymlinks = followSymlinks; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -42,7 +42,7 @@ public class PosixGroupSelector implements FileSelector { | |||||
| private String group; | private String group; | ||||
| private boolean followSymlinks = false; | |||||
| private boolean followSymlinks = true; | |||||
| /** | /** | ||||
| * Sets the group name to look for. | * Sets the group name to look for. | ||||
| @@ -53,11 +53,11 @@ public class PosixGroupSelector implements FileSelector { | |||||
| } | } | ||||
| /** | /** | ||||
| * Sets the "follow links" flag. | |||||
| * @param followSymlinks the user name | |||||
| * Sets the "follow symbolic links" option. | |||||
| * @param followSymlinks whether or not symbolic links should be followed. | |||||
| */ | */ | ||||
| public void setFollowSymlinks(String followSymlinks) { | |||||
| this.followSymlinks = PropertyHelper.toBoolean(followSymlinks); | |||||
| public void setFollowSymlinks(boolean followSymlinks) { | |||||
| this.followSymlinks = followSymlinks; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -41,7 +41,7 @@ public class PosixPermissionsSelector implements FileSelector { | |||||
| private String permissions; | private String permissions; | ||||
| private boolean followSymlinks = false; | |||||
| private boolean followSymlinks = true; | |||||
| /** | /** | ||||
| * Sets the permissions to look for. | * Sets the permissions to look for. | ||||
| @@ -63,11 +63,11 @@ public class PosixPermissionsSelector implements FileSelector { | |||||
| } | } | ||||
| /** | /** | ||||
| * Sets the "follow links" flag. | |||||
| * @param followSymlinks the user name | |||||
| * Sets the "follow symbolic links" flag. | |||||
| * @param followSymlinks whether or not symbolic links should be followed. | |||||
| */ | */ | ||||
| public void setFollowSymlinks(String followSymlinks) { | |||||
| this.followSymlinks = PropertyHelper.toBoolean(followSymlinks); | |||||
| public void setFollowSymlinks(boolean followSymlinks) { | |||||
| this.followSymlinks = followSymlinks; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -79,8 +79,8 @@ public class OwnedBySelectorTest { | |||||
| assertEquals(SELF, user.getName()); | assertEquals(SELF, user.getName()); | ||||
| s.setOwner(SELF); | s.setOwner(SELF); | ||||
| assertTrue(s.isSelected(null, null, symbolicLink.toFile())); | |||||
| s.setFollowSymlinks("yes"); | |||||
| assertFalse(s.isSelected(null, null, symbolicLink.toFile())); | assertFalse(s.isSelected(null, null, symbolicLink.toFile())); | ||||
| s.setFollowSymlinks(false); | |||||
| assertTrue(s.isSelected(null, null, symbolicLink.toFile())); | |||||
| } | } | ||||
| } | } | ||||
| @@ -86,8 +86,8 @@ public class PosixGroupSelectorTest { | |||||
| targetGroup.getName()); | targetGroup.getName()); | ||||
| s.setGroup(linkGroup.getName()); | s.setGroup(linkGroup.getName()); | ||||
| assertTrue(s.isSelected(null, null, symbolicLink.toFile())); | |||||
| s.setFollowSymlinks("yes"); | |||||
| assertFalse(s.isSelected(null, null, symbolicLink.toFile())); | assertFalse(s.isSelected(null, null, symbolicLink.toFile())); | ||||
| s.setFollowSymlinks(false); | |||||
| assertTrue(s.isSelected(null, null, symbolicLink.toFile())); | |||||
| } | } | ||||
| } | } | ||||
| @@ -124,9 +124,9 @@ public class PosixPermissionsSelectorTest { | |||||
| Path symbolicLink = Files.createSymbolicLink(target.toPath(), TEST_FILE.toPath()); | Path symbolicLink = Files.createSymbolicLink(target.toPath(), TEST_FILE.toPath()); | ||||
| s.setPermissions(argument); | s.setPermissions(argument); | ||||
| assertFalse(s.isSelected(null, null, symbolicLink.toFile())); | |||||
| s.setFollowSymlinks("yes"); | |||||
| assertTrue(s.isSelected(null, null, symbolicLink.toFile())); | assertTrue(s.isSelected(null, null, symbolicLink.toFile())); | ||||
| s.setFollowSymlinks(false); | |||||
| assertFalse(s.isSelected(null, null, symbolicLink.toFile())); | |||||
| } | } | ||||
| } | } | ||||