|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.ShareableUtil
public class ShareableUtil
Utility methods that will make it easier to implement
the Shareable
interface, including data validation.
Shareable
Constructor Summary | |
---|---|
ShareableUtil()
|
Method Summary | |
---|---|
static void |
copyPermissions(DbControl dc,
Shareable from,
Shareable to)
Copy permissions from one item to another. |
static ItemKey |
merge(DbControl dc,
ItemKey... keys)
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 a ShareableData object. |
static void |
setItemKey(ShareableData shareableData,
ItemKey itemKey)
Deprecated. Use setItemKey(DbControl, ShareableData, ItemKey) instead |
static void |
setProjectKey(ShareableData shareableData,
ProjectKey projectKey)
Set the project key of a ShareableData object. |
static int |
shareRecursively(DbControl dc,
Directory directory)
Share all files and sub-directories in the given directory with the same permissions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShareableUtil()
Method Detail |
---|
public static void setItemKey(ShareableData shareableData, ItemKey itemKey)
setItemKey(DbControl, ShareableData, ItemKey)
instead
ShareableData
object.
shareableData
- The data object to set the item key on. Null is not allowed.itemKey
- Item key to be set.public static void setProjectKey(ShareableData shareableData, ProjectKey projectKey)
ShareableData
object.
shareableData
- The data object to set project key to. Null is not allowed.projectKey
- Project key to be set.public static void setItemKey(DbControl dc, ShareableData shareableData, ItemKey itemKey)
ShareableData
object.
If the logged in user doesn't have Permission.SHARE_TO_EVERYONE
permission
then new item key must, if it includes sharing to the everyone group, have exactly
the same permissions as there is in the existing item key.
dc
- A DbControlshareableData
- The item to shareitemKey
- The new item key
PermissionDeniedException
- If the logged in user doesn't have permission
and the new item key contains a permission that is different from the
existing permissionpublic static int shareRecursively(DbControl dc, Directory directory)
Permission.SET_PERMISSION
on.
dc
- A DbControl for database accessdirectory
- The directory
public static void copyPermissions(DbControl dc, Shareable from, Shareable to)
Permission.SHARE_TO_EVERYONE
permission, the share to
everyone is removed. If the 'to' item is a new item and a project
is active the new item is also shared with the settings from
the project.
from
- The item to copy permissions fromto
- The item to copy permissions topublic static ItemKey merge(DbControl dc, ItemKey... keys)
keys
- An array with the item keys (null elements are ignored)
public static ProjectKey merge(DbControl dc, ProjectKey... keys)
keys
- An array with the project keys (null elements are ignored)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |