FAQ
whitespace


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/24f3afe7
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/24f3afe7
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/24f3afe7

Branch: refs/heads/master
Commit: 24f3afe7920e414a0ef83732fe4ea5aa58d17bce
Parents: 04b9e2b
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Mon May 16 11:46:04 2016 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Mon May 16 11:46:04 2016 +0200

----------------------------------------------------------------------
  .../tools/ant/taskdefs/SetPermissions.java | 36 ++++++++++----------
  1 file changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/24f3afe7/src/main/org/apache/tools/ant/taskdefs/SetPermissions.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/SetPermissions.java b/src/main/org/apache/tools/ant/taskdefs/SetPermissions.java
index e78914b..8716bee 100644
--- a/src/main/org/apache/tools/ant/taskdefs/SetPermissions.java
+++ b/src/main/org/apache/tools/ant/taskdefs/SetPermissions.java
@@ -143,29 +143,29 @@ public class SetPermissions extends Task {
          }
          Resource currentResource = null;
          try {
- for (Resource r : resources) {
- currentResource = r;
- try {
- PermissionUtils.setPermissions(r, permissions, this::posixPermissionsNotSupported);
- } catch (IOException ioe) {
- maybeThrowException(ioe, "Failed to set permissions on '%s' due to %s", r, ioe.getMessage());
- }
- }
+ for (Resource r : resources) {
+ currentResource = r;
+ try {
+ PermissionUtils.setPermissions(r, permissions, this::posixPermissionsNotSupported);
+ } catch (IOException ioe) {
+ maybeThrowException(ioe, "Failed to set permissions on '%s' due to %s", r, ioe.getMessage());
+ }
+ }
          } catch (ClassCastException uoe) {
- maybeThrowException(null, "some specified permissions are not of type PosixFilePermission: %s", StringUtils.join(permissions, ", "));
+ maybeThrowException(null, "some specified permissions are not of type PosixFilePermission: %s", StringUtils.join(permissions, ", "));
          } catch (SecurityException uoe) {
- maybeThrowException(null, "the SecurityManager denies role accessUserInformation or write access for SecurityManager.checkWrite for resource '%s'", currentResource);
+ maybeThrowException(null, "the SecurityManager denies role accessUserInformation or write access for SecurityManager.checkWrite for resource '%s'", currentResource);
          }
      }

- private void maybeThrowException(Exception ioe, String msgFormat, Object... msgArgs) {
- String msg = String.format(msgFormat, msgArgs);
- if (failonerror) {
- throw new BuildException(msg, ioe);
- } else {
- log("Warning: " + msg, Project.MSG_ERR);
- }
- }
+ private void maybeThrowException(Exception ioe, String msgFormat, Object... msgArgs) {
+ String msg = String.format(msgFormat, msgArgs);
+ if (failonerror) {
+ throw new BuildException(msg, ioe);
+ } else {
+ log("Warning: " + msg, Project.MSG_ERR);
+ }
+ }

      private void posixPermissionsNotSupported(Path p) {
          String msg = String.format("the associated path '%s' does"

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 3 | next ›
Discussion Overview
groupnotifications @
categoriesant
postedMay 16, '16 at 9:47a
activeMay 16, '16 at 9:47a
posts3
users1
websiteant.apache.org

1 user in discussion

Bodewig: 3 posts

People

Translate

site design / logo © 2017 Grokbase