Author: mturk
Date: Mon Sep 7 15:59:08 2009
New Revision: 812212
URL: http://svn.apache.org/viewvc?rev=812212&view=rev
Log:
Implement second setProtection API
Modified:
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SharedMemory.java
Modified:
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SharedMemory.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SharedMemory.java?rev=812212&r1=812211&r2=812212&view=diff
==============================================================================
---
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SharedMemory.java
(original)
+++
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SharedMemory.java
Mon Sep 7 15:59:08 2009
@@ -312,5 +312,20 @@
return chown0(shm, FileProtection.bitmapOf(prot), null, null);
}
+ /**
+ * Set protection for the {...@code this} SharedMemory object.
+ * <p>
+ * </p>
+ * @param prot The {...@code EnumSet} determining the access permissions.
+ * @param user Change object owner user to {...@code User}.
+ * @param group Change object owner group to {...@code Group}.
+ */
+ public boolean setProtection(User user, Group group,
EnumSet<FileProtection> prot)
+ throws IOException, SecurityException
+ {
+ return chown0(shm, FileProtection.bitmapOf(prot),
+ user.Id, group.Id);
+ }
+
}