Package net.sf.basedb.core
Class ShareableUtil
java.lang.Object
net.sf.basedb.core.ShareableUtil
Utility methods that will make it easier to implement
the
Shareable
interface, including data validation.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
- Last modified
- $Date: 2011-03-16 12:48:47 +0100 (on, 16 mar 2011) $
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyPermissions
(DbControl dc, Shareable from, Shareable to) Copy permissions from one item to another.static ItemKey
Merge one or more item keys into a new item key that combines all the permissions.static ProjectKey
merge
(DbControl dc, ProjectKey... keys) Merge one or more project keys into a new project key that combines all the permissions.static void
setItemKey
(DbControl dc, ShareableData shareableData, ItemKey itemKey) Set the item key of aShareableData
object.static void
setProjectKey
(ShareableData shareableData, ProjectKey projectKey) Set the project key of aShareableData
object.static int
shareRecursively
(DbControl dc, Directory directory) Share all files and sub-directories in the given directory with the same permissions.
-
Constructor Details
-
ShareableUtil
public ShareableUtil()
-
-
Method Details
-
merge
Merge one or more item keys into a new item key that combines all the permissions.- Parameters:
keys
- An array with the item keys (null elements are ignored)- Returns:
- A new or existing item key
- Since:
- 2.16
-
merge
Merge one or more project keys into a new project key that combines all the permissions.- Parameters:
keys
- An array with the project keys (null elements are ignored)- Returns:
- A new or existing project key
- Since:
- 2.16